WP Mail SMTP v0.8

As promised, I’m releasing version 0.8 of the WP Mail SMTP plugin just a few days after WordPress 2.7 was released.

There are some big changes in this version. Firstly, I added option whitelisting to be forward compatible with WordPress. This also makes the plugin compatible with WordPressMU. However, this means version 0.8 is is only compatible with 2.7 or newer. This version will not work on WordPress 2.6.5 or earlier.

I’m going to hold off pushing this update to wordpress.org for a couple of days. I’m hoping to get some feedback from early testers. If there are no disasters, I’ll release 0.8 onto wordpress.org early next week.

Support Questions

If you have a question, please search the questions for 0.7 and the original questions before asking it here.

Please note: If you post email addresses in the body of the comments you will almost certainly receive spam. Please replace all @ symbols with something else when you post the debugging output (not in the email box, just in the comment box).

1,238 thoughts on “WP Mail SMTP v0.8

  1. How can I verify that I have your plugin correctly configured so that all emails sent via my form plugin are secure? I have an application and contact us form. The form plugin uses wp_mail.

  2. I think your comment below might work, but I’m not sure how to make this change in woocommerce- what file do I modify? I have been going through and can’t tell what php file makes email happen. Any tips are welcome! :) Thanks for the great plugin!

    No email from plugins?

    If you’re using plugins to send email, these plugins will ignore the SMTP settings if they call PHP’s mail() function directly. 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! (Insert lawyer-speak no warranty blurb here!)

  3. Hi. I posted a question several weeks ago and it seems to have disappeared. From what I understand, properly configuring the WP Mail SMTP plugin will ensure all emails are sent securely automatically. My form plugin has wp_mail in the code. How do I test to see if the emails are passing through secure servers? Can the host be set to mail.simco-apts.com? Will selecting SSL change port 25 to the SSL port of 465? Thx.

    • Selecting SSL will not change the port number, you must also change the port number. You can test using a tool like wireshark to inspect network traffic. How to do that is well beyond the scope of plugin support.

  4. Hi Callum,
    Because PHP ereg function has been DEPRECATED as of PHP 5.3.0, your plugin needs a patch on email validation, replacing ereg with preg_match.

    Below I leave you the fix but if you want, write me an email and I will send you the diff file.

    diff -r 18d67b4f4f9e wp-content/plugins/wp-mail-smtp/wp_mail_smtp.php
    — a/wp-content/plugins/wp-mail-smtp/wp_mail_smtp.php Fri Nov 01 15:42:05 2013 +0000
    +++ b/wp-content/plugins/wp-mail-smtp/wp_mail_smtp.php Fri Nov 01 16:00:20 2013 +0000
    @@ -348,7 +348,7 @@
    */
    if (!function_exists(‘validate_email’)) :
    function validate_email( $email, $check_domain = true) {
    - if (ereg(‘^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+’.’@’.
    + if (preg_match(‘^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+’.’@’.
    ‘[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.’.
    ‘[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$’, $email))
    {

      • Callum,
        I’m really sorry about my mistake: I forgot to escape some slashes…

        Below you will find the right diff

        diff -r 18d67b4f4f9e wp-content/plugins/wp-mail-smtp/wp_mail_smtp.php
        — a/wp-content/plugins/wp-mail-smtp/wp_mail_smtp.php Fri Nov 01 15:42:05 2013 +0000
        +++ b/wp-content/plugins/wp-mail-smtp/wp_mail_smtp.php Fri Nov 01 16:32:56 2013 +0000
        @@ -348,9 +348,9 @@
        */
        if (!function_exists(‘validate_email’)) :
        function validate_email( $email, $check_domain = true) {
        - if (ereg(‘^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+’.’@’.
        + if (preg_match(‘/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`a-z{|}~]+’.’@’.
        ‘[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.’.
        - ‘[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$’, $email))
        + ‘[-!#$%&\'*+\\.\/0-9=?A-Z^_`a-z{|}~]+$/’, $email))
        {
        if ($check_domain && function_exists(‘checkdnsrr’)) {
        list (, $domain) = explode(‘@’, $email);

  5. Hi Callum! I updated your plugin about 10 minutes ago and right after I did I was unable to access anywhere in my WP Dashboard. I had to go in through FTP and delete the plugin.

    • When I tried to upload and activate it again, this is what I got:

      Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of apply_filters(). in /opt/bitnami/apache2/htdocs/wordpress_youthg/wp-content/plugins/wp-mail-smtp/wp_mail_smtp.php on line 109

        • Hi, your plug-in doesn’t update correctly with WordPress 3.7.1. I’m getting “Could not remove the old plug-in” error message when I try to update. Please advise… Thanks!

    • Thanks for the link, apologies for the issue. I’ve pushed a new version 0.9.3 now which should fix the problem. Please let me know if you have any further issues.

  6. The latest version of this plugin causes errors with the latest version of WordPress. Lines 109 and 150 contain bad syntax for function calls that will prevent wordpress from loading a web site once the plugin is updated to version 0.9.2

    • Apologies for the issue. I just pushed version 0.9.3 which should fix this problem. Please let me know if you have any further issues.

  7. Hi,

    I’m using your plugin in order to send emails via authenticated SMTP. I have now got it opened at the SMTP server so that we can relay there and the Test mail works – reports true and the mail arrives. However, if I try sending using wp_mail from my plugin it doesn’t work – wp_mail returns true and the email does not arrive. I put some debugging code in the wp_mail function, ihncluding that I debug out the $e->getMessage() from the catch block in the try/catch at the very end of wp_mail (when it tries to send the actual mail). This says “SMTP Error: Could not authenticate.” However, as said, the test mails work!

    I then started debuggin out the phpmailer object and comparing between my wp_mail call and yours. i noticed that the exceptions protected member was true for mine and not for the test mail. It appears that the global phpmailer does not exist when coming in to wp_mail in my call, so it is created in wp_mail using $phpmailer = new PHPMailer( true ) If I change that true to a false (i.e. set exceptions to false in the phpmailer object) then not only does wp_mail return true but the mail arrives!

    How can I be getting authentication errors but the mail still be arriving if I check for errors? Any ideas?

    • Replying to my own comment after further investigation.

      It appears that the Test Email function continues to try and send the email even if authentication fails. The mail server seems to allow me to relay even without authenticating so the Test Email gets through. Actual calls to wp_mail from my plugin fail if the authentication fails. If I turn of SMTP authentication then my mails work as well.

      I count this as a bug in the Test Email functionality – if the Test Email says OK then I should be able to rely on that that other wp_mail calls will work too. however, in this case I cannot. At the very least there should be a clear warning at the top of the test Email output (“Succeeded but with errors” or similar).

      • I’m assuming that you are sending to your own address with the test function. If you do that, most likely your mail server accepts it. It’s not so much a bug as a misunderstanding of the SMTP protocol. It could definitely be clearer on the admin page though. I’ll add something to make that more obvious.

        • The email I sent using the Test Email functionality in the plugin (which arrived) and the email I tried but failed to send using the wp_mail call in my plugin were both to the same address. The question is not whether the authentication worked or not, the point is that the Test Email functionality has a bug in that it reports that emails can be sent when wp_mail fails to be able to send the same mail. The whole point of the Test Email function is to test whether sending emails will work – if the result cannot be trusted then the function has a bug (in my opinion). As I said, at the very least there should be a clear warning that success from the Test Email function does not indicate that wp_mail will necessarily work.

          • The test email function calls wp_mail() and that’s it. There’s no magic to it. For a long time, the wp_mail() function returned true whether the mail was sent or not. I think that bug has now been fixed in WP core.

            If you’re using code>wp_mail() in your plugin, the result should be exactly the same as the test email function.

            • The Test Email function may use wp_mail, but it (or something else) must have created a global PHPMailer object before calling wp_mail. The Test Email function uses a debugging version of PHPMAiler (i.e. with exceptions allowed). wp_mail uses the existing PHPOMailer if it exists and otherwise creates one with exceptions not allowed.

              As I said in the original post, if we allow exceptions (i.e. if I change the “$phpmailer = new PHPMailer( true )” to “$phpmailer = new PHPMailer( false )” in wp_mail then my wp_mail calls work as well. But with wp_mail as it stands they don’t. If I set debugging code in wp_mail I see that the PHPMailer object used when Test Email calls wp_mail was created as “$phpmailer = new PHPMailer( false )”. wp_mail creates with true so the object must have been created before the wp_mail call. The problem is that this changes the functionality, including whether or not the mail actually arrives!

              • You’re absolutely right. The code in wp-includes/pluggable.php has changed, and now the PHPMailer() object is instantiated differently than it used to be. I’ll update the plugin and push a new version now. Those two were (and should be) identical. I need to instantiate the PHPMailer object in order to set the SMTP debugging in order to get the output. Enabling debugging shouldn’t change how the mail is sent, but instantiating the object differently may well make a difference.

                Thanks for the bug report. Apologies if I was overly dismissive, I get an awful lot of “my server no work, help” type emails about the plugin, and many from folks who seem to forget that the code was free! :-)

                • Thanks! I am aware that the code is free (and very much appreciated!). My initial report maybe should have been clearer.

                  As a side note, this forum doesn’t seem to cope with threads this long very well… :)

                  • Yeah, nested comments get a bit out of control.

                    So, I’ve looked into this a bit further, and it gets even weirder. In my tests, if I instantiate the PHPMailer() object with false then my test email sends, but if I set true it fails, with an actual SMTP server error. It seems like a combination of $exceptions = true; with $SMTPDebug = 2; causes mail sending to fail.

                    Ok, after a bit more research, it looks like the SMTPDebug option has changed from a numerical value to a boolean. Changing it to true works for me. Now I can send test emails and get a debug log, with the PHPMailer object instantiated with $exceptions = true;. :-)

  8. Hi, I’am using Contact Form 7.
    My settings:
    1) To send I installed the plugin WP-Mail-SMTP and configured:
    - From Email: email@nomesito.it
    - From Name: nomesito.it
    - Mailer: Send all WordPress emails via SMTP .
    - SMTP Host: [my internal SMTP service]
    - SMTP Port: 25
    - Encryption: No encryption .
    - Authentication: No: Do not use SMTP authentication .
    I made ​​a test using the form for this test and mail arrives correctly .
    2) I have configured my FORM of Contact Form 7 and everything is working correctly, because, as I have entered is specified in the “To:” and in the “From:” the same email as above, ie email@nomesito.it
    Performed a test, sending succeeds.
    I tried, however, to allow multiple selection of the recipient:
    [select * recipient
    "Technical Support | assistenzatecnica@nomesito.it"
    "Commercial | sales@nomesito.it"
    "General | rsalemi@nomesito.it"
    "Administrative support | amministrazione@nomesito.it"
    ]
    and set the two fields fields:
    - “TO:” -> [your recipient]
    - “FROM”: – > [your-name]
    Sending does not work anymore: this is because the field “To:” FORM is different from the “From Email:” in the configuration.
    I would like to avoid creating 4 contact blocks, you have any suggestions?
    The site will be published through my local server made ​​with Wampserver.
    Maybe instead of sending STMP should I use the PHPMailer class?
    Thanks in advance for your help.

    • I guess your issue relates to sending email to your own address via your own server. That usually works without authentication, but you can’t send mail to anywhere through your own server without authentication (otherwise your server would be used by spammers).

  9. Hi

    Need to set smtp plugin to send emails from original sender, not smtp authenticated user. Any idea how to go aobut it?

    wp 3.7.1 – SMTP 0.9.3

    tnx,

    Zvi

  10. I hope I’m not posting a duplicate question. I did search first.

    Anyway, my “test mail” to myself after configuration returns with this error message:

    ["ErrorInfo"]=>
    string(90) “The following From address failed: doug@lerner.net : Called Mail() without being connected”

    I am using Gmail Google Apps and have the settings as recommended (in fact exactly as in my mail client):

    smtp.gmail.com
    SSL on
    Authentication: on
    Port 465 (also tried port 587)
    username: my email address
    password: my password

    I’m running WP 3.7.1 and WP-Mail SMTP 0.9.3.

    Any thoughts? The reason I was interested in this is because lately Subscribe2Html which send my posts out doesn’t reach a few Gmail users (including me!), and my hosting site suggested I might try using SMTP instead of the PHP email I have been using.

    Thanks,

    Doug

    • Gmail is funny about relaying messages where the “From” address doesn’t match your gmail address. I think it just changes the from address, or maybe it doesn’t allow the messages. Are you using two factor authentication? If the SMTP settings are correct, and any mails get through, the issue lies with the mail server. Otherwise, maybe your web server doesn’t allow outgoing connections.

      • Thanks for your response. In my case, the Gmail address and the from address are the same – just my personal email address.

        I am not using two-factor authentication. Just ordinary username and password.

        Note that with the plugin turned off, email sent from my WP blog generally works ok. But there are a few addresses (including my own!) which simply do not receive the mail. So it was suggested by various people, including my web host, that I try to relay via an SMTP server instead, as your plugin does.

        So you think I should ask the host of my web server if outgoing connections are being disallowed?

        Thanks,

        Doug

      • A followup. I had my web host provider look at it. They tweaked permissions or whatever on their end, but were not able to get it to work.

        However, if I switch the setting to “Use PHP Mail” it does work.

        But is there any point in doing that? Doesn’t that mean I’m back to where I started and not using SMTP at all?

        Thanks,

        Doug

        • If you use the mail() setting, you can still use the from name and email settings, but the rest is ignored. You’re probably back to the position you were in before you started in terms of jail delivery, yes.

          • Interesting. What I am seeing is:

            (1) With your plugin enabled and PHP mail selected this time the mail that was not arriving at my personal address is arriving. So something about your plugin is helping, even though SMTP is not selected.

            (2) However, the from name I selected in your plugin “Doug’s Blog” is not name on the sent mails. The name on the sent mails is just “doug”.

            I’m confused. :)

            doug

  11. Putting aside sending via Gmail for the moment, I changed the settings to use SMTP again, and am sending them through a “regular” hosted SMTP server for another account I have.

    This time sending via SMTP works.

    But I’m back with the original problem I had when I began looking at SMTP plugins. For some reason, everybody gets my blog notices except my mother and sister. The three of us are in a Gmail apps account with a private domain (my lerner.net domain). My notifications arrive, but theirs just don’t. They aren’t in spam either. My web host looked at the logs and they show they are being delivered.

    I was hoping that using this would help solve this problem, which I think was caused by PHP mail, but I guess it doesn’t.

    Any tips-or-tricks you can think of?

    Thanks,

    Doug

    • Sorry, thought I’d replied to this already. You’re sending emails via Google’s SMTP server’s and you’re using authentication? Or you’re sending via your hosting company’s SMTP servers? If the from address is your Google Apps address, then that might explain why the notifications reach you but not the other addresses.

      Did you find a solution in the end?

      • Hi. No, I never found a solution in the end. I can’t send from my blog via SMTP using the Gmail servers. And my mother and sister don’t receive my blog notifications – though some other people who use Gmail do.

        It remains a mystery to me.

        Thanks,

        doug

  12. Hello, I am trying to get my website to send emails from my gmail account, it seems impossible, I know my host is blocking because of “spoofing” and when I try to send through SMTP i get

    SMTP -> ERROR: Failed to connect to server: Connection timed out (110)

    I am 99.9% sure my settings are correct, could it be that the host is blocking port 587 for gmail?

    • Word of warning, Gmail will force the “From” address to be your Gmail address, no matter what. So you can’t send an email to you that appears to be “From” somebody else (via a contact form for example).

      Could be that your host blocks the port. Or maybe blocks all outgoing connections. Google’s SMTP servers require SSL, so it’s also worth checking that your server supports outgoing connections over SSL.

  13. Hi Callum,

    I am using Gravity Forms ver 3.2 on a website which uses notifications to send out PDF files of the application sent to the Admin and the User. We installed your plugin and it still does not work. See below:

    SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP? (0)

    Where would I make that correction

  14. If I use the plugin for multisite, should I also update these manually?:?
    ====
    global $wpms_options; // This is horrible, should be cleaned up at some point
    $wpms_options = array (
    ‘mail_from’ => ”,
    ‘mail_from_name’ => ”,
    ‘mailer’ => ‘smtp’,
    ‘mail_set_return_path’ => ‘false’,
    ‘smtp_host’ => ‘localhost’,
    ‘smtp_port’ => ’25′,
    ‘smtp_ssl’ => ‘none’,
    ‘smtp_auth’ => false,
    ‘smtp_user’ => ”,
    ‘smtp_pass’ => ”
    ====

  15. wp_mail interception not working; but test mail is using WP Mail SMTP settings.

    Dear callum,

    it seems that even though the test mail feature uses the settings from the plugin, a wp_mail call is not altered; it still sends mail directly to PHP mail() function …

    Any ideas?

  16. I am trying to use wp-mail-smtp on a WordPress network. Your documentation says “put your settings in wp-config.php and then disable the admin menu”. How is this done?

      • Hi there! Same here, couldn’t find the settings for wp-config.php anywhere, then started browsing the source for the plugin and found them there. Might be helpful to include those on the plugin install or FAQ page. :-)
        Great plugin! Using it with Mandrill with no problems.

  17. Please, could you hide the password by default? Maybe using a password field instead of a text field. I don’t know…

  18. Hello I have downloaded and installed “visual form builder” and WP Mail SMTP v0.8. They both are great!, thank you for working on this plugging!. I just have a little bit of a thing, whenever I try the plugging it works perfect but send the e-mail to the dashboard under forms. I need it to send it to l.gutierrez@multilingualgroup.com. How can I do that?, thank you so much. I understand you are busy. But youtrhelp on this will mean a lot for me. Thank you and have a great day!

    • I’m not sure what you’re trying to do. This plugin does not change who messages are sent to, that’s down to whatever form plugin you’re using.

  19. Hi Callum,

    I really need your help (happy to pay).

    I installed http://wordpress.org/plugins/wp-mail-smtp/ onto my 3.7.1 version of WP because I use gravity forms and it recommended I get SMTP for WP in order to send notifications. It installed fine, and I configured the settings but on sending the test email it crashed the site into a 500 error.

    My site came back online by itself 2 minutes later, but now runs REALLY slow, almost backwards. I’m now panicking because my business relies on the site and if its not working properly we’re in trouble!!!! Stupidly i hadn’t done a backup before installing and cant afford to go back a month to the last backup.

    Can you please help me work out what has happened?!!

    Happy to pay for a fix as need this doing ASAP

    Many thanks

    Pete

    • Uninstall the plugin. If your sites goes back to being “fast”, then your problem is solved. If not, the problem lies somewhere else than in the plugin. It’s virtually impossible that this plugin causes your site to load slowly, but that’s the surest way to figure out if it is.

  20. Hi, I just started using your plugin and it’s great. I’m not sure if this has already been answered somewhere, but I would like to change the content of the email that is sent. It may be beyond the scope of your plugin, but do you know a way to accomplish this?

    Thanks!

  21. Hello, i used Easy WP SMTP v1.0.7 plugin but i get this error:- SMTP -> ERROR: Failed to connect to server: The requested address is not valid in its context.
    (10049)

  22. Hi Callum,

    I’m new to both WordPress, Woocommerce and coding in general. I’m using WordPress with Woocommerce and the Mystile theme and am having an issue with the contact form.

    When an email is sent to us (info@muggles.co.za) we don’t get it. The one sent to the person sending the mail comes through when I test it but I am not receiving the actual email sent to us.

    I was advised by the support desk at WooThemes to do the following:

    “It could be that it is blocked by other server’s SPAM filters even before it hits your mail server. What you can try and do is use a dedicated SMTP provider to send your emails instead of relying on the WordPress default server email functionality.
    I suggest you install a plugin like WP-Mail-SMTP and then configure it to use something like a GMail account or another SMTP mail account.”

    So I installed your plugin and setup a Gmail account (mugglesandmore@gmail.com) as instructed but am still having problems.

    I set everything up as per your suggested settings found on this site but I am getting the following error when trying to send the test email:

    “Test Message Sent

    The result was:
    bool(false)

    The full debugging output is shown below:
    object(PHPMailer)#261 (65) {
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["From"]=>
    string(23) “wordpress@muggles.co.za”
    ["FromName"]=>
    string(7) “Muggles”
    ["Sender"]=>
    string(23) “wordpress@muggles.co.za”
    ["ReturnPath"]=>
    string(0) “”
    ["Subject"]=>
    string(51) “WP Mail SMTP: Test mail to sara_ainscow@hotmail.com
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["MIMEBody":protected]=>
    string(69) “This is a test email generated by the WP Mail SMTP WordPress plugin.

    ["MIMEHeader":protected]=>
    string(458) “Date: Thu, 6 Feb 2014 20:27:30 +0000
    Return-Path: wordpress@muggles.co.za
    To: sara_ainscow@hotmail.com
    From: Muggles
    Subject: WP Mail SMTP: Test mail to sara_ainscow@hotmail.com
    Message-ID:
    X-Priority: 3
    X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/plain; charset=UTF-8


    ["mailHeader":protected]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["UseSendmailOptions"]=>
    bool(true)
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    string(0) “”
    ["MessageDate"]=>
    string(0) “”
    ["Host"]=>
    string(14) “smtp.gmail.com”
    ["Port"]=>
    string(3) “465″
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(true)
    ["Username"]=>
    string(24) “mugglesandmore@gmail.com”
    ["Password"]=>
    string(10) “mugsgalore”
    ["AuthType"]=>
    string(0) “”
    ["Realm"]=>
    string(0) “”
    ["Workstation"]=>
    string(0) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(0) “”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_passphrase"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["Version"]=>
    string(5) “5.2.4″
    ["XMailer"]=>
    string(0) “”
    ["smtp":protected]=>
    object(SMTP)#262 (11) {
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["do_verp"]=>
    bool(false)
    ["Timeout"]=>
    int(10)
    ["Timelimit"]=>
    int(30)
    ["Version"]=>
    string(5) “5.2.4″
    ["smtp_conn":"SMTP":private]=>
    bool(false)
    ["error":"SMTP":private]=>
    array(1) {
    ["error"]=>
    string(38) “Called Reset() without being connected”
    }
    ["helo_rply":"SMTP":private]=>
    NULL
    }
    ["to":protected]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(24) “sara_ainscow@hotmail.com”
    [1]=>
    string(0) “”
    }
    }
    ["cc":protected]=>
    array(0) {
    }
    ["bcc":protected]=>
    array(0) {
    }
    ["ReplyTo":protected]=>
    array(0) {
    }
    ["all_recipients":protected]=>
    array(1) {
    ["sara_ainscow@hotmail.com"]=>
    bool(true)
    }
    ["attachment":protected]=>
    array(0) {
    }
    ["CustomHeader":protected]=>
    array(0) {
    }
    ["message_type":protected]=>
    string(5) “plain”
    ["boundary":protected]=>
    array(3) {
    [1]=>
    string(35) “b1_9c09a455c02f4b6ffdc244255560ebd2″
    [2]=>
    string(35) “b2_9c09a455c02f4b6ffdc244255560ebd2″
    [3]=>
    string(35) “b3_9c09a455c02f4b6ffdc244255560ebd2″
    }
    ["language":protected]=>
    array(18) {
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: Data not accepted.”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_connect_failed"]=>
    string(22) “SMTP Connect() failed.”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count":protected]=>
    int(2)
    ["sign_cert_file":protected]=>
    string(0) “”
    ["sign_key_file":protected]=>
    string(0) “”
    ["sign_key_pass":protected]=>
    string(0) “”
    ["exceptions":protected]=>
    bool(true)
    }

    The SMTP debugging output is shown below:
    SMTP -> ERROR: Failed to connect to server: Connection timed out (110)”

    Sorry for the long explanation but I wanted to give you all the details. As I said I’m new to all of this and don’t have a clue how coding works although I did try to find the mail() story to change it to the wp_mail() as suggested elsewhere but I couldn’t find it.

    Please can you tell me what I’m doing wrong? It is probably some simple little setting but I don’t have a clue why it won’t work. If you need any further information please let me know and I will send what I can through asap.

    Thanks so much for your help, it is really appreciated.

    Regards

    Sara

  23. I am using version 0.9.4 of WP-Mail- SMPT. I am using Gmail to send the email, however when I change the settings at the top of the Advanced Email Options it still defaults to the gmail email address instead of the one I have set the options too. What am I doing wrong?

  24. I’m having trouble with the reply-to address.

    From address is set to service2@customerthink.com. When I send out a test email, the from address is fine, and if I hit reply the reply-to address is the same. So far, so good.

    But, when I test real comment notifications (core WP function) to the post author, the from address is ok (service2@…) but the reply-to address is the commenter.

    This is a security issue, because the commenter won’t expect to get an email directly from the post author if he happens to hit reply and send.

    I’ve checked the box “Set the return-path to match the From Email” and it doesn’t help. The reply-to is the commenters, not the from address.

    Thanks,
    Bob

  25. i cant send email after change the host and domain …
    please help …

    Test Message Sent
    The result was:
    bool(false)
    The full debugging output is shown below:
    object(PHPMailer)#451 (65) {
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["From"]=>
    string(27) “kareem.moh.khalil@gmail.com”
    ["FromName"]=>
    string(16) “Don’t Smok EGYPT”
    ["Sender"]=>
    string(0) “”
    ["ReturnPath"]=>
    string(0) “”
    ["Subject"]=>
    string(54) “WP Mail SMTP: Test mail to kareem.moh.khalil@gmail.com
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["MIMEBody":protected]=>
    string(69) “This is a test email generated by the WP Mail SMTP WordPress plugin.

    ["MIMEHeader":protected]=>
    string(478) “Date: Thu, 20 Feb 2014 12:51:38 +0000
    Return-Path: kareem.moh.khalil@gmail.com
    To: kareem.moh.khalil@gmail.com
    From: Don’t Smok EGYPT
    Subject: WP Mail SMTP: Test mail to kareem.moh.khalil@gmail.com
    Message-ID:
    X-Priority: 3
    X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/plain; charset=UTF-8


    ["mailHeader":protected]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["UseSendmailOptions"]=>
    bool(true)
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    string(0) “”
    ["MessageDate"]=>
    string(0) “”
    ["Host"]=>
    string(14) “smtp.gmail.com”
    ["Port"]=>
    string(3) “465″
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(true)
    ["Username"]=>
    string(27) “kareem.moh.khalil@gmail.com”
    ["Password"]=>
    string(9) “Km1121990″
    ["AuthType"]=>
    string(0) “”
    ["Realm"]=>
    string(0) “”
    ["Workstation"]=>
    string(0) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(0) “”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_passphrase"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["Version"]=>
    string(5) “5.2.4″
    ["XMailer"]=>
    string(0) “”
    ["smtp":protected]=>
    object(SMTP)#450 (11) {
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["do_verp"]=>
    bool(false)
    ["Timeout"]=>
    int(10)
    ["Timelimit"]=>
    int(30)
    ["Version"]=>
    string(5) “5.2.4″
    ["smtp_conn":"SMTP":private]=>
    bool(false)
    ["error":"SMTP":private]=>
    array(1) {
    ["error"]=>
    string(38) “Called Reset() without being connected”
    }
    ["helo_rply":"SMTP":private]=>
    NULL
    }
    ["to":protected]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(27) “kareem.moh.khalil@gmail.com”
    [1]=>
    string(0) “”
    }
    }
    ["cc":protected]=>
    array(0) {
    }
    ["bcc":protected]=>
    array(0) {
    }
    ["ReplyTo":protected]=>
    array(0) {
    }
    ["all_recipients":protected]=>
    array(1) {
    ["kareem.moh.khalil@gmail.com"]=>
    bool(true)
    }
    ["attachment":protected]=>
    array(0) {
    }
    ["CustomHeader":protected]=>
    array(0) {
    }
    ["message_type":protected]=>
    string(5) “plain”
    ["boundary":protected]=>
    array(3) {
    [1]=>
    string(35) “b1_2faaa226d39aa033555bb523b7f71c07″
    [2]=>
    string(35) “b2_2faaa226d39aa033555bb523b7f71c07″
    [3]=>
    string(35) “b3_2faaa226d39aa033555bb523b7f71c07″
    }
    ["language":protected]=>
    array(18) {
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: Data not accepted.”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_connect_failed"]=>
    string(22) “SMTP Connect() failed.”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count":protected]=>
    int(2)
    ["sign_cert_file":protected]=>
    string(0) “”
    ["sign_key_file":protected]=>
    string(0) “”
    ["sign_key_pass":protected]=>
    string(0) “”
    ["exceptions":protected]=>
    bool(true)
    }
    The SMTP debugging output is shown below:
    SMTP -> ERROR: Failed to connect to server: Permission denied (13)

  26. Hi Callum,

    Your plugin does not authenticate with my smtp server and instead produces the error “fputs() expects parameter 1 to be resource, integer given in class-smtp.php in line 308″

    I use have installed version 0.9.4 of your wp-mail-smpt plugin and I run PHP Version 5.3.27.

    Could you please help me? I use your plugin to enable registration for a design competition and we have over 700 designers registered who try to send emails using our WP form.

    Many thanks in advance!
    Rogier

    • Sounds like your server doesn’t have the correct PHP options enabled. I guess that the error means your server can’t connect.

  27. I tested the contact form but it gives me this message: An error occured – your message has not been sent. Please try again.

    I checked with the web server and they said the SMTP details are all working properly and that the contact form settings is the one that needs fixing. Help!

    • Not sure what the issue is, doesn’t sound like this plugin. Maybe find more information about what the error message means on the contact form plugin.

  28. Hello. I’m hoping someone can shed some insight into an issue I’ve been encountering. When new members register, they don’t receive their password. The only way around this is using the “Forgot Password” function (after which the new password link is successfully sent to users). Could this be a plugin issue on WP Mail SMTP’s end? I tried sending myself a test email and it went through immediately with no errors, but I wanted to throw this out there in case others have experienced this issue.

    Thanks in advance!

  29. hello

    how do I setup the reply to correctly? it’s sending my message back to me when i reply the contact form.

  30. Hi I am getting the following error when trying to sign up with gmail!
    The error result was:

    bool(false)
    The full debugging output is shown below:
    object(PHPMailer)#959 (65) {
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["From"]=>
    string(23) “my gmail email address went here”
    ["FromName"]=>
    string(24) “Hire My Wedding Supplier”
    ["Sender"]=>
    string(0) “”
    ["ReturnPath"]=>
    string(0) “”
    ["Subject"]=>
    string(52) “WP Mail SMTP: Test mail to my email address went here”
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["MIMEBody":protected]=>
    string(69) “This is a test email generated by the WP Mail SMTP WordPress plugin.

    ["MIMEHeader":protected]=>
    string(483) “Date: Wed, 19 Mar 2014 14:10:53 +0000
    Return-Path: my gmail email address went here
    To: my email address went here
    From: Hire My Wedding Supplier
    Subject: WP Mail SMTP: Test mail to my email address went here
    Message-ID:
    X-Priority: 3
    X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/plain; charset=UTF-8


    ["mailHeader":protected]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["UseSendmailOptions"]=>
    bool(true)
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(22) “www.hiremysupplier.com”
    ["MessageID"]=>
    string(0) “”
    ["MessageDate"]=>
    string(0) “”
    ["Host"]=>
    string(14) “smtp.gmail.com”
    ["Port"]=>
    string(3) “465″
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(true)
    ["Username"]=>
    string(23) “my gmail address went here”
    ["Password"]=>
    string(10) “my gmail password went here”
    ["AuthType"]=>
    string(0) “”
    ["Realm"]=>
    string(0) “”
    ["Workstation"]=>
    string(0) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(0) “”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_passphrase"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["Version"]=>
    string(5) “5.2.4″
    ["XMailer"]=>
    string(0) “”
    ["smtp":protected]=>
    object(SMTP)#961 (11) {
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["do_verp"]=>
    bool(false)
    ["Timeout"]=>
    int(10)
    ["Timelimit"]=>
    int(30)
    ["Version"]=>
    string(5) “5.2.4″
    ["smtp_conn":"SMTP":private]=>
    bool(false)
    ["error":"SMTP":private]=>
    array(1) {
    ["error"]=>
    string(38) “Called Reset() without being connected”
    }
    ["helo_rply":"SMTP":private]=>
    NULL
    }
    ["to":protected]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(25) “my email address went here”
    [1]=>
    string(0) “”
    }
    }
    ["cc":protected]=>
    array(0) {
    }
    ["bcc":protected]=>
    array(0) {
    }
    ["ReplyTo":protected]=>
    array(0) {
    }
    ["all_recipients":protected]=>
    array(1) {
    ["my email address went here"]=>
    bool(true)
    }
    ["attachment":protected]=>
    array(0) {
    }
    ["CustomHeader":protected]=>
    array(0) {
    }
    ["message_type":protected]=>
    string(5) “plain”
    ["boundary":protected]=>
    array(3) {
    [1]=>
    string(35) “b1_1c924626f1f5f671635ff7d1a9d9a4e4″
    [2]=>
    string(35) “b2_1c924626f1f5f671635ff7d1a9d9a4e4″
    [3]=>
    string(35) “b3_1c924626f1f5f671635ff7d1a9d9a4e4″
    }
    ["language":protected]=>
    array(18) {
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: Data not accepted.”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_connect_failed"]=>
    string(22) “SMTP Connect() failed.”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count":protected]=>
    int(2)
    ["sign_cert_file":protected]=>
    string(0) “”
    ["sign_key_file":protected]=>
    string(0) “”
    ["sign_key_pass":protected]=>
    string(0) “”
    ["exceptions":protected]=>
    bool(true)
    }
    The SMTP debugging output is shown below:
    SMTP -> ERROR: Failed to connect to server: Connection refused (111)

  31. Test Message Sent
    I am using wordpress 3.8.1

    The result was:
    bool(false)
    The full debugging output is shown below:
    object(PHPMailer)#229 (65) {
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["From"]=>
    string(18) “atul7173@gmail.com”
    ["FromName"]=>
    string(4) “Atul”
    ["Sender"]=>
    string(0) “”
    ["ReturnPath"]=>
    string(0) “”
    ["Subject"]=>
    string(45) “WP Mail SMTP: Test mail to atul7173@gmail.com
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["MIMEBody":protected]=>
    string(69) “This is a test email generated by the WP Mail SMTP WordPress plugin.

    ["MIMEHeader":protected]=>
    string(425) “Date: Wed, 2 Apr 2014 12:00:47 +0000
    Return-Path: atul7173@gmail.com
    To: atul7173@gmail.com
    From: Atul
    Subject: WP Mail SMTP: Test mail to atul7173@gmail.com
    Message-ID:
    X-Priority: 3
    X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/plain; charset=UTF-8


    ["mailHeader":protected]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["UseSendmailOptions"]=>
    bool(true)
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    string(0) “”
    ["MessageDate"]=>
    string(0) “”
    ["Host"]=>
    string(9) “localhost”
    ["Port"]=>
    string(2) “25″
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(true)
    ["Username"]=>
    string(18) “atul7173@gmail.com”
    ["Password"]=>
    string(3) “123″
    ["AuthType"]=>
    string(0) “”
    ["Realm"]=>
    string(0) “”
    ["Workstation"]=>
    string(0) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(0) “”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_passphrase"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["Version"]=>
    string(5) “5.2.4″
    ["XMailer"]=>
    string(0) “”
    ["smtp":protected]=>
    object(SMTP)#294 (11) {
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["do_verp"]=>
    bool(false)
    ["Timeout"]=>
    int(10)
    ["Timelimit"]=>
    int(30)
    ["Version"]=>
    string(5) “5.2.4″
    ["smtp_conn":"SMTP":private]=>
    bool(false)
    ["error":"SMTP":private]=>
    array(1) {
    ["error"]=>
    string(38) “Called Reset() without being connected”
    }
    ["helo_rply":"SMTP":private]=>
    NULL
    }
    ["to":protected]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(18) “atul7173@gmail.com”
    [1]=>
    string(0) “”
    }
    }
    ["cc":protected]=>
    array(0) {
    }
    ["bcc":protected]=>
    array(0) {
    }
    ["ReplyTo":protected]=>
    array(0) {
    }
    ["all_recipients":protected]=>
    array(1) {
    ["atul7173@gmail.com"]=>
    bool(true)
    }
    ["attachment":protected]=>
    array(0) {
    }
    ["CustomHeader":protected]=>
    array(0) {
    }
    ["message_type":protected]=>
    string(5) “plain”
    ["boundary":protected]=>
    array(3) {
    [1]=>
    string(35) “b1_758f04117597ad9f60a7f344fba82a54″
    [2]=>
    string(35) “b2_758f04117597ad9f60a7f344fba82a54″
    [3]=>
    string(35) “b3_758f04117597ad9f60a7f344fba82a54″
    }
    ["language":protected]=>
    array(18) {
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: Data not accepted.”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_connect_failed"]=>
    string(22) “SMTP Connect() failed.”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count":protected]=>
    int(2)
    ["sign_cert_file":protected]=>
    string(0) “”
    ["sign_key_file":protected]=>
    string(0) “”
    ["sign_key_pass":protected]=>
    string(0) “”
    ["exceptions":protected]=>
    bool(true)
    }
    The SMTP debugging output is shown below:
    SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP? (113983616)

  32. Hello,

    I’m getting the same failure to connect messages with both of my SMTP servers (1 with google, 1 with fastmail).

    I have verified that I have the SMTP info correct and they are otherwise working. I’ve also made sure the From name matches the email, etc. Still no luck.

    I’d appreciate any help you can offer.

    I’ve pasted below the Test message results.

    Thanks
    ==========

    Test Message Sent
    The result was:
    bool(false)
    The full debugging output is shown below:
    object(PHPMailer)#835 (65) {
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["From"]=>
    string(16) “zt@twistmail.net”
    ["FromName"]=>
    string(13) “Zachary Twist”
    ["Sender"]=>
    string(0) “”
    ["ReturnPath"]=>
    string(0) “”
    ["Subject"]=>
    string(45) “WP Mail SMTP: Test mail to list@mailworks.org
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["MIMEBody:protected"]=>
    string(69) “This is a test email generated by the WP Mail SMTP WordPress plugin.

    ["MIMEHeader:protected"]=>
    string(440) “Date: Fri, 4 Apr 2014 19:15:15 +0000
    Return-Path: zt@twistmail.net
    To: list@mailworks.org
    From: Zachary Twist
    Subject: WP Mail SMTP: Test mail to list@mailworks.org
    Message-ID:
    X-Priority: 3
    X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/plain; charset=UTF-8


    ["mailHeader:protected"]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["UseSendmailOptions"]=>
    bool(true)
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    string(0) “”
    ["MessageDate"]=>
    string(0) “”
    ["Host"]=>
    string(24) “mail.messagingengine.com”
    ["Port"]=>
    string(3) “465″
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(true)
    ["Username"]=>
    string(16) “zt@twistmail.net”
    ["Password"]=>
    string(13) “*******”
    ["AuthType"]=>
    string(0) “”
    ["Realm"]=>
    string(0) “”
    ["Workstation"]=>
    string(0) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(0) “”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_passphrase"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["Version"]=>
    string(5) “5.2.4″
    ["XMailer"]=>
    string(0) “”
    ["smtp:protected"]=>
    object(SMTP)#821 (11) {
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["do_verp"]=>
    bool(false)
    ["Timeout"]=>
    int(10)
    ["Timelimit"]=>
    int(30)
    ["Version"]=>
    string(5) “5.2.4″
    ["smtp_conn:private"]=>
    bool(false)
    ["error:private"]=>
    array(1) {
    ["error"]=>
    string(38) “Called Reset() without being connected”
    }
    ["helo_rply:private"]=>
    NULL
    }
    ["to:protected"]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(18) “list@mailworks.org”
    [1]=>
    string(0) “”
    }
    }
    ["cc:protected"]=>
    array(0) {
    }
    ["bcc:protected"]=>
    array(0) {
    }
    ["ReplyTo:protected"]=>
    array(0) {
    }
    ["all_recipients:protected"]=>
    array(1) {
    ["list@mailworks.org"]=>
    bool(true)
    }
    ["attachment:protected"]=>
    array(0) {
    }
    ["CustomHeader:protected"]=>
    array(0) {
    }
    ["message_type:protected"]=>
    string(5) “plain”
    ["boundary:protected"]=>
    array(3) {
    [1]=>
    string(35) “b1_78212b24715d38a90793ffe9af897f49″
    [2]=>
    string(35) “b2_78212b24715d38a90793ffe9af897f49″
    [3]=>
    string(35) “b3_78212b24715d38a90793ffe9af897f49″
    }
    ["language:protected"]=>
    array(18) {
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: Data not accepted.”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_connect_failed"]=>
    string(22) “SMTP Connect() failed.”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count:protected"]=>
    int(2)
    ["sign_cert_file:protected"]=>
    string(0) “”
    ["sign_key_file:protected"]=>
    string(0) “”
    ["sign_key_pass:protected"]=>
    string(0) “”
    ["exceptions:protected"]=>
    bool(true)
    }
    The SMTP debugging output is shown below:
    SMTP -> ERROR: Failed to connect to server: Connection refused (111)

    • You posted your email address and your password above by the way. I’d suggest changing your password immediately.

      Your web server probably isn’t set up to make outgoing connections, or the specific host you’re trying to access is blocked. Try contacting your server administrator.

  33. Hello Callum,

    I hope your week is off to a good start. I am using the WP SMTP plug-in and it works well with gmail hosting. Thanks for the plug-in.

    I am running into an issue though. I am using Gravity Forms which sends an email from the From email specified. However, when I receive the email, it is from the default email address, not the one I specified in Gravity Forms. I contacted Gravity Forms and they said the setting is probably being over-written by the WP Mail SMTP plug-in.

    My issue seems to be similar to http://wordpress.org/support/topic/plugin-contact-form-7-sender-from-email-is-not-appearing-in-mail-when-using-smtp-plugin. Was there ever a resolution?

    Thank you,

    Joey

    • Are you using Gmail? They automatically change the from address to your Gmail address. Unless your email is sent from “wordpress@sitename” then WP Mail SMTP does not change the From address.

  34. I installed your plugin and it works great. I am wanting to add the settings in the wp-config.php I copy pasted the code (filling in the correct info for my server of course) and it does not seem to be working. the email tab is still visible in wp and emails aren’t going out. Is there another line i need to add or comment out to get your plugin to take the info from the config file as opposed to the gui?

    Any help would be great!

    Thanks for all your work, it is greatly appreciated.

    • Did you remove the /* and the */ from around the code? These two marks stop everything in between them from being processed by PHP (anything between them is ignored). Did you put it into the wp-config.php file above the line that says “stop editing here”?

  35. Callum,

    I’m using wordpress + woocommerce. I used to get new order confirmation emails but my customers did not. I switched to wp-smtp-mail and now neither myself or my customers are getting the confirmation emails.

    I have tried a yahoo account, a hotmail account, a gmail account, a live account and a company email account – I can’t get any of these emails to work with the plug-in.

    I’ve run over blogs and forums and triple checked the SMTP settings a million times.

    I am now only able to get emails through my “contact us” page using “PHP mail() function” to send emails.

    When I delete the plug-in, I can’t get emails at all from my wordpress site. It’s been like this since the first time I installed the plug-in. There has to be a setting somewhere that wasn’t erased when I first configured the plug-in.

    I either need to start receiving SMTP emails or I just want everything to go back to the way it was where only I was getting the confirmation emails and not my customers. Anything is better than nothing. I could really use your help and hope you can offer some helpful hints.

    If you need more information from me I would be more than happy to offer it. I hope to hear from you soon. Have a great day.

    • If you disable the plugin there is no code left behind. There are a few values written to the wp_options table, but these are not used by anything else. It is not possible for the plugin to modify WordPress in any way that would continue after it was uninstalled or deleted. Maybe another plugin or theme is using the same option names in wp_options, you could remove those values if you want. Then the plugin will be 100% uninstalled.

      Otherwise, if you have the plugin installed, you can try the test email functionality and see what it reports. I’d also suggest contacting your hosting provider to ask them if PHP is allowed to make outgoing connections, if any ports are blocked, and if PHP is compiled with SSL support (necessary for most email providers).

    • Either the hostname is wrong, PHP is not allowed to make outgoing connections, there’s a DNS issue, or the outgoing port may be blocked by your hosting provider.

  36. Please explain WHY the plugin is useful. Why would someone choose WP Mail SMTP over the PHP Mail function.

  37. I’m trying to set up a contact form to send emails to a godaddy email account, it will send emails to every other email address I try other than the godaddy email address! I have followed your instructions and yet I’m getting this error message when I test the email and havent received any of the emails – can you please help me? Thanks

    Advanced Email Options
    Test Message Sent
    The result was:
    bool(false)
    The full debugging output is shown below:
    object(PHPMailer)#501 (69) {
    ["Version"]=>
    string(5) “5.2.7″
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(22) “SMTP connect() failed.”
    ["From"]=>

    • You can send to all addresses except one? That’s almost certainly caused by the configuration of your mail server. Are you sending the messages from GoDaddy’s server via GoDaddy’s mail server? Maybe there’s an issue there somehow, could be worth asking them.

  38. Hi

    i recive this message :

    Test Message Sent
    The result was:
    bool(false)
    The full debugging output is shown below:
    object(PHPMailer)#7897 (69) {
    ["Version"]=>
    string(5) “5.2.7″
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(22) “SMTP connect() failed.”
    ["From"]=>
    string(12) “iam@alihm.ir”
    ["FromName"]=>
    string(21) “قالب وردپرس”
    ["Sender"]=>
    string(0) “”
    ["ReturnPath"]=>
    string(0) “”
    ["Subject"]=>
    string(39) “WP Mail SMTP: Test mail to iam@alihm.ir
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["Ical"]=>
    string(0) “”
    ["MIMEBody:protected"]=>
    string(69) “This is a test email generated by the WP Mail SMTP WordPress plugin.

    ["MIMEHeader:protected"]=>
    string(433) “Date: Wed, 7 May 2014 03:49:43 +0000
    Return-Path:
    To: iam@alihm.ir
    From: =?UTF-8?B?2YLYp9mE2Kgg2YjYsdiv2b7Ysdiz?=
    Subject: WP Mail SMTP: Test mail to iam@alihm.ir
    Message-ID:
    X-Priority: 3
    X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit


    ["mailHeader:protected"]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["UseSendmailOptions"]=>
    bool(true)
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    string(0) “”
    ["MessageDate"]=>
    string(0) “”
    ["Host"]=>
    string(20) “smtp.mandrillapp.com”
    ["Port"]=>
    string(3) “587″
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(true)
    ["Username"]=>
    string(18) “hamyarwp@gmail.com”
    ["Password"]=>
    string(22) “QOC-dKdiFNkqegGU1Z_ueQ”
    ["AuthType"]=>
    string(0) “”
    ["Realm"]=>
    string(0) “”
    ["Workstation"]=>
    string(0) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["do_verp"]=>
    bool(false)
    ["AllowEmpty"]=>
    bool(false)
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(0) “”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_passphrase"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["XMailer"]=>
    string(0) “”
    ["smtp:protected"]=>
    object(SMTP)#7898 (12) {
    ["Version"]=>
    string(5) “5.2.7″
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["do_verp"]=>
    bool(false)
    ["Timeout"]=>
    int(10)
    ["Timelimit"]=>
    int(30)
    ["smtp_conn:protected"]=>
    bool(false)
    ["error:protected"]=>
    NULL
    ["helo_rply:protected"]=>
    NULL
    ["last_reply:protected"]=>
    string(0) “”
    }
    ["to:protected"]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(12) “iam@alihm.ir”
    [1]=>
    string(0) “”
    }
    }
    ["cc:protected"]=>
    array(0) {
    }
    ["bcc:protected"]=>
    array(0) {
    }
    ["ReplyTo:protected"]=>
    array(0) {
    }
    ["all_recipients:protected"]=>
    array(1) {
    ["iam@alihm.ir"]=>
    bool(true)
    }
    ["attachment:protected"]=>
    array(0) {
    }
    ["CustomHeader:protected"]=>
    array(0) {
    }
    ["lastMessageID:protected"]=>
    string(54) “”
    ["message_type:protected"]=>
    string(5) “plain”
    ["boundary:protected"]=>
    array(3) {
    [1]=>
    string(35) “b1_c5e721cbdd21e3d80bbb9811d5757e0b”
    [2]=>
    string(35) “b2_c5e721cbdd21e3d80bbb9811d5757e0b”
    [3]=>
    string(35) “b3_c5e721cbdd21e3d80bbb9811d5757e0b”
    }
    ["language:protected"]=>
    array(18) {
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: data not accepted.”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_connect_failed"]=>
    string(22) “SMTP connect() failed.”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count:protected"]=>
    int(2)
    ["sign_cert_file:protected"]=>
    string(0) “”
    ["sign_key_file:protected"]=>
    string(0) “”
    ["sign_key_pass:protected"]=>
    string(0) “”
    ["exceptions:protected"]=>
    bool(true)
    }
    The SMTP debugging output is shown below:
    SMTP -> ERROR: Failed to connect to server: (0)

    can you help me ?

    • Does your server allow outgoing connections? I’d guess that PHP is not allowed to make outgoing connections, or that the port or host is blocked by your hosting company. Check with the server admin if PHP can make outgoing connections.

  39. I solved my question:

    add_filter(‘wp_mail_smtp_custom_options’, ‘smtp_replyto’,98,1);
    function smtp_replyto($phpmailer){
    $phpmailer->AddReplyTo(‘mail@ext.it’,’Name’);
    $phpmailer->SetFrom(‘mail@ext.it’,’Name’);
    return $phpmailer;
    }

    • Can this method be used to add a bcc: address? if so, how, and what file to I have to modify? Thanks.

      • Ahh – Figured it out! I added this — $phpmailer->addBCC(“address@domain.tld”, “WebsiteBCC”); — after line 149 on wp_mail_smtp.php

  40. Hi Callum,

    I have used your plugin for 2 websites and thank you for creating it.

    I wonder if you would be willing to make the contents of the authentication password field hidden, ie. a series of dots. Reason is, leaving the password visible leaves the email account vulnerable if the website is hacked. Having ones website hacked would be enough of a problem, and it happens enough these days, but having one’s email address so easily accessed by such a hacker would compound the problem.

    Since one of the core benefits of the plugin is to allow one to send secure emails using SSL, anyone using that feature would be already concerned about security, which is the case with both times I have needed to it.

    As a temporary work around for both of my cases I have created new email addresses specifically for use of the website, but this is not idea.

    Either way, thanks again. David

  41. Hi Callum, as mentioned by others here, I would also like to ask you to kindly hide the SMTP authentication password field (ie. use dots to hide it), as it is a security risk for me to have that password visible.

    Thanks!

  42. Hi Callum,
    Thank you for your great plugin.

    when sending mails it throws error

    The SMTP debugging output is shown below:

    Warning: stream_set_timeout() has been disabled for security reasons in /home/… .com/httpdocs/wp-includes/class-smtp.php on line 197

    Warning: stream_set_timeout() has been disabled for security reasons in /home/… .com/httpdocs/wp-includes/class-smtp.php on line 965

    how can we configure this error.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>