WordPress SMTP Email Problem

Discussion in 'Third-party applications' started by mauro218, May 16, 2011.

  1. Hi there,

    I installed Wordpress and WP Mail SMTP plugin successfully using the post Ray has: http://forum.Winhost.com/showthread.php?t=5198&highlight=wordpress+email

    I created a page for contact which includes the following code:

    $subject = 'Contact Submission from ' . $name . ' about '. $mySubject;
    $body = 'Name: ' . $name . ' \nEmail: ' . $email . ' \nComments: ' . $comments;
    $headers = 'From: ' . $mySite . ' <'.$myEmail.'>' . "rn" . 'Reply-To: ' . $email;

    mail($myEmail, $subject, $body, $headers);

    I have the following setting on the WP Mail SMTP plugin:

    SMTP Host: mail.mysite.com
    SMTP Port: 25
    Encryption Encryption No encryption.
    Authentication: Yes: Use SMTP authentication.
    Username: full email address (Hosted and Provided by Winhost)
    Password: password for the email
    ---------------------------------------------------------------

    After these settings I tried to use the contact form and gave me the following error:

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\web\mysite\wp-content\themes\bluemasters\contact.php on line 68

    It seems like the mail() function is not using the WP Mail SMTP setting and it's trying to use the Winhost localhost mail function.

    Can anybody tell me what else do I need to change to make it work?
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    It looks like you did not install the SMTP module for wordpress correctly. If you did you will not be using the php mail() function. Make sure you installed and enabled the SMTP module for wordpress.
     
  3. Ray,

    I installed and enabled the WP Mail SMTP plugin. Is that all I needed to install? or is there something else I need to install?

    I deleted and re-installed the WP Mail SMTP plugin but no luck.

    Jhonny
     
  4. Ray

    Ray

    You will still need to go to the plugin and set it up to connect to the Winhost server and pass smtp authentication.
     
    Last edited by a moderator: Oct 14, 2015
  5. Ray,

    I'm using the following settings:

    SMTP Host: mail.mysite.com
    SMTP Port: 25
    Encryption Encryption No encryption.
    Authentication: Yes: Use SMTP authentication.
    Username: full email address (Hosted and Provided by Winhost)
    Password: password for the email

    And nothing. Anything am I missing?

    Jhonny
     
  6. Solved

    Ray,

    I found the answer under the author's page

    http://www.callum-macdonald.com/code/wp-mail-smtp/

    "If you see the function mail() and not wp_mail() in the plugin’s source, that’s the problem. You should be able to simply add wp_ in front of the existing mail command and it will probably work!"

    I added the wp_ and no more errors.

    Thanks for the help!

    Jhonny
     
  7. Ray

    Ray

    Thanks for the follow up. Good to know.
     

Share This Page