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,094 thoughts on “WP Mail SMTP v0.8

  1. Hi,

    I’d like to know if I can use `PHPMailer["Username"]` programmatically within my theme’s code. I’ve tried `$PHPMailer->Username`, but without luck. And `var_dump($PHPMailer);` returns `null`.

    What I am trying to achieve is that the email will be sent to the same account that is used to make SMTP authentication. That way, my client will only set the SMTP details in one place (through the admin interface) and then she’ll be able to get the emails to this same account. And in case she wants to change the address – she’ll still get the emails to this same account.

    Thanks!

    • It’s $phpmailer not $PHPMailer and it’s probably in the global scope, so you’ll need global $phpmailer; first. I’m not sure what you mean about using the same values as on the SMTP page, but if you want to access those, it’s probably easier to use the options api, like get_option('mail_from'); for the from email set on that page.

      • Great, thanks!

        I was able to just use get_option(‘smtp_user’) in order to use the same email as set on plugin configuration page (that’s what I meant, sorry for not being clear).

        • To be clear, smtp_user is *not* necessarily an email address, it’s a username, which might be an email (with the like of gmail) but is not an email address with many providers.

  2. If I send through local host the test mail goes. I have gmail accounts which do not work. Is smtp.gmail.com a valid address? Is gmail no allowing smtp activity any more?

    This is the settings I used:

    Gmail / Google Apps
    To send email via Gmail or Google Apps, use these settings:
    Mailer: SMTP
    SMTP Host: smtp.gmail.com
    SMTP Port: 465
    Encryption: SSL
    Authentication: Yes
    Username: your full gmail address
    Password: your mail password

  3. hello,

    is there a way to see wich emails that have been automatically sent to my subscribers does not reach the recipient so that i can delete these email address that no longer ecxists from my subscribe list?

    Thanks

    • You should get bounce messages if the messages failed, you’d need to ask your mail server administrator. In theory, those bounces should reach the from address. This plugin only modifies the way emails are sent, it does nothing to handle bounces, remove subscribers or otherwise, it’s purely how mail is sent.

  4. Hey Callum, I’m using your plugin on an in-house project and would like to send you a patch for updating a depracated warning in wp3.0+ I’m using the latest 0.9.1 version of your plugin. Let me know how I can send it to you.

    Thanks!
    -Marcus

  5. I installed your plugin a few weeks ago and it worked fine until a few days ago. The email function on the site has completely stopped working. When I ran a test email, this is what I get: SMTP -> ERROR: Failed to connect to server: (0)

    SMTP Error: Could not connect to SMTP host.

    I’ve spent hours trying to troubleshoot and haven’t been successful. Any help that you could offer would be most appreciated.
    Thank you kindly.

    • I’m not sure what to suggest in this instance. Has something changed on the server? Have you upgraded WordPress, another plugin? Has anything changed on the mailserver end? That error usually means that either the mailserver is invalid, or PHP doesn’t have permission to connect to remote hosts.

      • The same thing happened to me. Was working great until around the same time, and then only get the cannot connect to host message.

        • Not sure what to suggest, are you guys on the same host? If nothing has changed in WordPress or the plugin, I’d guess the issue lies elsewhere. Any plugin / theme updates at the time of the change?

  6. I have installed your plugin and used it many times but now I am getting an error, I am running WP 3.2.1 with Genesis Framework Ver. 1.7.1 and the AgentPress 2.0 Child Theme by Studiopress.

    Plugin is Ver. 0.9.1 and it seems to be conflicting with my site, I was unable to add a custom menu or disable other plugins until after removing the Email Plugin. I have since reinstalled it, but I am now unable to activate it just kicks me back to the home page and doesn’t activate.

    Please let me know if you have any ideas

    Thanks

    • Hi thanks for the great plugin, unfortunatly it is not working right now I am running the latest version of WP with the latest version of Genesis Framework.

      I am unable to activate the plugin all of a sudden, originally I couldn’t deactivate it and it was preventing me from adding a custom menu

      any ideas on what is going on?

      Thanks

      Josh

      • It sounds like there might be a conflict between the plugin and something else you have installed. I’m not sure what would cause that though, every function definition is wrapped in conditional tags, so it seems unlikely that the plugin would conflict with something else. If you manage to figure out what the issue is, would you be so kind as to post back here?

        • Hello Sir,

          I think I may have found the issue. I started going through one plugin at a time and it appears their may be some kind of conflict or false positive while WordPress Firewall 2 is active. I was able to activate and deactivate the smtp plugin no problem once I deactivated the WP Firewall 2 plugin.

          not sure how much it has to do with the issue but while the firewall is active certain things don’t work so that leads me to believe the firewall may be blocking certain functions. I will post again if I can confirm this or if I find a different answer, but as of now it looks like I can modify the smtp plugin but need to do it while the firewall is off.

  7. Hi Callum,

    If I have your plugin active (I’m using WordPress 3.2.1), when I’m at my wp-login page, if I click the ‘forgot my password’ link and enter my email, I get the following error:

    The e-mail could not be sent.
    Possible reason: your host may have disabled the mail() function…

    When I disable your plugin, the feature works.

    Fair enough if that’s just something I have to deal with, but I’d appreciate any ideas you have any ideas for how to get around that.

    Thank you for sharing your plugin. :)

    • That message is a little misleading. It’s generated here. It means that WordPress was unable to send the recover password email. Are you able to send a test message to the same address as the recover password message is being sent to?

      • I found that on the password recovery/reset process, the plugin was returning the default from email of “wordpress@smswordpress.com” rather than “chad@smswordpress.com”. My smtp account authentication failed as a result. To fix this, I manually coded the wp_mail_smtp_mail_from function by adding this line at the top of the function “return ‘chad@smswordpress.com’;”. I know this is a hack but don’t have time to dig any deeper right now. It works for now.

        • This might have the unintended consequence of always setting the from address as yours, even when WordPress is sending an email from somebody else (for example, in the case of comment notifications, where the From address is set to the person who posted the comment). If you’re able to figure out why your setup isn’t working, and find a bug in the code, please do let me know. The plugin is used by many people across many types of host and I haven’t had any similar bug reports recently.

  8. Just sent you the following email and then saw you ignore stuff about contact plugin.

    ‘ I know you are ‘retiring’ from WordPress guruness and I also know this problem is not caused by your plugin but………………….
    I need someone with some WordPress emailer knowledge to help me solve this problem with 123-reg (who I will leave as soon as I can afford dedicated hosting!!)
    Please have a look at http://wordpress.org/support/topic/wp-mail-smtp-php-mailer-and-smtp-returning-errors and, with your knowledge, please just tell me what PHP file concatenates information to provide the directory path that is being returned as ‘not found’ in your marvellous plug in.
    123 cheat by virtualising the directory structure that some functions require to be predictable.
    I have only just started out in this business being a .Net programmer (and still am) and am trying to supplement income with WordPress.
    I now host 6 sites that can’t use email contact forms because 123-reg deny responsibility!!
    Just a hint or two would help enormously. Please?
    Many thanks
    Alan

  9. Hi Callum,

    Thank you very much for WP Mail SMTP v0.8! It works great! :)

    I seem to have run into a very minor bug, and I hope that it can be reproduced on your end too.

    I am running WordPress 3.2.1 on Windows, IIS, and PHP 5.2.14.

    So basically when I am on the Email Settings page, the url is
    http://www.myblog.com/wordpress/wp-admin/options-general.php?page=wp-mail-smtp/wp_mail_smtp.php.
    When I click on the “Save Changes” button, I see the “Settings saved” message and everything looks good except for the url now points to http://www.myblog.com/wordpress/wp-admin/options.php. And so now if I enter an email address in the “To:” field and click on the “Send Test” button, I am redirected to the url: http://www.myblog.com/wordpress/wp-admin/options.php.

    However, if I go back to the Email Settings, enter an email address in the “To:” field and click on the “Send Test” button, it works as expected, and subsequent “Send Test” submits also work as expected.

    I notice in the html and php the “Save Changes” form indicates method=”post” action=”options.php” but I don’t have a lot of knowledge about the wordpress framework to know if this is fine or not.

    I am using iis url rewrite, appending the query string, and pretty permalinks is turned on, so I’m not sure if this is only happening on my site or not, but it is possible.

    Thanks again! :D

  10. Hi, I installed SMTP plugin.

    But what is totally weird here, is that everything works as it should in Safari and Firefox. But in IE7 and IE8 Contact Form doesn’t send email.

    As I see it, it cannot be a server problem, if it works in some browsers and not in others.

    Any suggestions on that?

    • I recommend asking the contact form plugin author. The WP Mail SMTP plugin only affects how mail is sent, not the contact form functionality.

  11. Hello Callum,

    We greatly appreciate your plug-in and have used it for some time. I do have something to run by you however.

    We are hosted by bluehost, and after some issues with how they handle email, we decided to use gmail to be our email servers. We setup our email addresses via Google Apps for Business and have multiple sign in enabled. The email address we are using as the reply-to address is one of those email addresses, but not the primary email address. We use the primary email address and password as the login. When I enter the SMTP options as outlined by Google, I get SMTP -> ERROR: Failed to connect to server: Connection refused (111)
    SMTP Error: Could not connect to SMTP host. I get this error using Port 25 and TLS encryption. When I use SSL and your recommended port setting (memory is failing me at the moment), I get a timeout response. However, when I use the exact same settings (Port 25 and TLS) in Outlook 2007, it sends and receives email just fine. I do not have a firewall installed in WordPress, so I’m not sure what is going on. Do you have any suggestions? I’ve gone back and looked at all the posts back to 2008, but haven’t had any luck with a remedy as yet.

    Thanks in advance for your assistance in these matters.

    Jeff

    • Bluehost probably block port 25 so you can’t send email outgoing on that port. Also, if memory serves me, gmail requires SSL not TLS. Ask Bluehost if PHP can make outgoing connections, this is the most common error reported, it’s related to php.ini fopen() permissions I think.

      • I appreciate the feedback. I’ve opened a support ticket with bluehost and will let you know what I find out.

        Merry Christmas to you as well.

        Thanks,
        Jeff

  12. As a follow-up to my post yesterday, I also tried using port 465 and SSL with Outlook 2007 and it worked just fine also.

  13. Using contact Form 7, what file do I find “mail()” in? I understand I need to change it to “wp_mail()” Thanks in advance.

    • I think contact form 7 integrates already. Otherwise, search the entire source code for occurrences of mail(). This regex might work /mail\s*(/ for you.

  14. Hello Callum ,
    I just installed your plugin as well and I am receiving this error from Post 25 as well so please can you help me out.

    The SMTP debugging output is shown below:

    SMTP -> ERROR: Failed to connect to server: Connection refused (111)

    SMTP Error: Could not connect to SMTP host.

  15. Hello Callum,

    I’m working on a website for a client and I am using your plugin. On my main contact form it works with no issues, I also have a quick contact form in my footer (its a widget). Looking at the source code for the widget, I noticed it was using the mail() function so I changed this to use the wp_mail() function instead as suggested above, but I still can’t send any email from the quick contact form.

    Any suggestions.

    Regards,
    Stephen

  16. Hi Callum

    I appreciate your work on this.. Trying to get this working on HostGator VPS, and getting could not connect error. I am investigating php settings,and I was wondering if you had a phpinfo page on a working host I could compare to mine to help troubleshoot this.
    thx for any help!

    • Great idea, and amazingly, the first time anyone has ever asked! I’ll whip one up now and email it to you. I’ll be very interested to hear what you find.

  17. Hi Callum,

    Just started using your plugin (v.0.9.1) but running into a (small) problem.
    Although I succeed in sending mails via Google SMTP, the ‘From Email’ value is always ignored (either the default value or an entered value), the ‘From Name’ however does seem to work. I therefore always receive the mails from the username used for authentication.
    Any thoughts on this behaviour?

    Thanks in advance.

    • I believe Gmail always overrides the From email address as a spam prevention measure. This question has been asked and answered before.

  18. Hi,
    I am using your plugin with Contact Form 7 to send emails. In a form we have it sends the first email to the website owner and the second one to the client.

    I am trying to make it so the email to the website owner bypasses your plugin. How would I do this?

    Thanks you,

    Dennis

    • There’s no easy way to bypass the plugin for some messages and not for others. The code is GPL so you’re welcome to rewrite it to add additional functionality if you like.

  19. I am using WP-Mail-SMTP on a site and I am trying to have a BCC on the email. How do I do this? Currently I am using the WP_Mail function and doing this:

    $header .= “Bcc:aaron@company.com”;

    Is this how I should be doing it? This is not working for me :(

    Thanks!

  20. Hi Callum,

    First of all thank you for your great plugin! Great job!

    Second of all, here comes one tiny issue – I think Google considers me as spammer for emailing way too many automated notifications about new comments on my blog via GoogleApp email account.

    Maybe I am doing something wrong. But I get such replies on outgoing comment notifications (use Comment Notifier by Satollo):
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    Delivery to the following recipient failed permanently:

    address@mail.com

    Technical details of permanent failure:
    Message rejected. See http://support.google.com/mail/bin/answer.py?answer=69585 for more information.

    —– Original message —–

    Received: by 10.152.132.130 with SMTP id ousdada11f4564346313294459862804;
    Thu, 16 Feb 2012 09:24:42 -0800 (PST)
    Return-Path:
    Received: from germanblog.ru (server.xxx.com [111.11.11.11])
    by mx.google.com with ESMTPS id w1s45343fblbq.13.2012.02.16.09.24.41
    (version=SSLv3 cipher=OTHER);
    Thu, 16 Feb 2012 09:24:41 -0800 (PST)
    Date: Thu, 16 Feb 2012 17:24:41 +0000
    Return-Path: email@germanblog.ru
    To: address@mail.com
    From: “Germanblog.ru”
    Subject: =?UTF-8?B?0J3QvtCy0YvQuSDQvtGC0LLQtdGCINC90LAg0LLQsNGIINC60L7QvNC80LU=?=
    =?UTF-8?B?0L3RgtCw0YDQuNC5IHwgR2VybWFuYmxvZy5ydQ==?=
    Message-ID:
    X-Priority: 3
    X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net)
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset=”UTF-8″
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    Everything else (Contact Form 7, test emails) works perfect. Only hundreds of comment notifications are not being delivered.

    Many thanks in advance!
    Alex

    • It does look like Google’s servers are rejecting the message. Could it be that the message contains a comment which is in fact spam? Personally, I use SendGrid to send emails from my server and WordPress. An account with up to 40k emails per month is free to Rackspace customers. I could furnish you with a referral link if you’re currently unable to login to your Rackspace control panel. ;-)

      • Thanks, Callum, for such a quick reply!

        No, all comments on my blog are 99% spam-free (thanks, Akismet!). But I think that due to the fact that notification about the same new comment is send to about 100 email addresses, Google considers it as spam.

        Would be great to ensure Google that my mails are not spam. Do you have any suggestions or any cases similar to my in your practice?

        Thank you for the SendGrid suggestion, but I would like to stick to Google services.

        Maybe there is something I should inform my hoster about in order to change the situation?

        Thanks,
        Alex

        • I believe sending the same message to many people will cause problems. If you always send to the same group of people you could use a mailing list. Also, to be clear, SendGrid is an email delivery service, your replies would still go through gmail. I think SendGrid or your own mailserver is the “correct” technical solution.

  21. In the setting field can you please set the password field to be “password” type? I dont want my clients to be able to see my google password. Thank you.

  22. I have your plugin installed and activated. We on our own server and I it pointed to our appropriate smtp server. When i attempt to send a test message, it tells me that the dubugger results bool (true) but at the bottom it tells me that it rejected the From address? Is this maybe because the From address is different than our hosting domain?

    • If your mail server is rejecting the From address, I’m not sure what’s causing that. Can you paste the relevant error messages? If you’re using the correct SMTP server and settings, then I’d guess the plugin is working as expected, and the issue lies on the mailserver end.

      • The following is what I get. I hope you don’t mind, i Xed out the emails and IP for our SMTP server.

        Test Message Sent

        The result was:

        bool(true)
        The full debugging output is shown below:

        object(PHPMailer)#213 (53) {
        ["Priority"]=>
        int(3)
        ["CharSet"]=>
        string(5) “UTF-8″
        ["ContentType"]=>
        string(10) “text/plain”
        ["Encoding"]=>
        string(4) “8bit”
        ["ErrorInfo"]=>
        string(79) “The following From address failed: XXXXXXXXXX@XXXXXXXXXXXXXXXXXX.com
        ["From"]=>
        string(44) “XXXXXX@XXXXXXXXXXXXXXXXXX.com”
        ["FromName"]=>
        string(9) “WordPress”
        ["Sender"]=>
        string(0) “”
        ["Subject"]=>
        string(56) “WP Mail SMTP: Test mail to XXX@XXXXXX.com
        ["Body"]=>
        string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
        ["AltBody"]=>
        string(0) “”
        ["WordWrap"]=>
        int(0)
        ["Mailer"]=>
        string(4) “smtp”
        ["Sendmail"]=>
        string(18) “/usr/sbin/sendmail”
        ["PluginDir"]=>
        string(0) “”
        ["ConfirmReadingTo"]=>
        string(0) “”
        ["Hostname"]=>
        string(0) “”
        ["MessageID"]=>
        string(0) “”
        ["Host"]=>
        string(9) “XXX.X.X.X”
        ["Port"]=>
        string(2) “25″
        ["Helo"]=>
        string(0) “”
        ["SMTPSecure"]=>
        string(0) “”
        ["SMTPAuth"]=>
        bool(false)
        ["Username"]=>
        string(0) “”
        ["Password"]=>
        string(0) “”
        ["Timeout"]=>
        int(10)
        ["SMTPDebug"]=>
        int(2)
        ["SMTPKeepAlive"]=>
        bool(false)
        ["SingleTo"]=>
        bool(false)
        ["SingleToArray"]=>
        array(0) {
        }
        ["LE"]=>
        string(1) ”

        ["DKIM_selector"]=>
        string(9) “phpmailer”
        ["DKIM_identity"]=>
        string(0) “”
        ["DKIM_domain"]=>
        string(0) “”
        ["DKIM_private"]=>
        string(0) “”
        ["action_function"]=>
        string(0) “”
        ["Version"]=>
        string(3) “5.1″
        ["smtp:private"]=>
        object(SMTP)#214 (7) {
        ["SMTP_PORT"]=>
        int(25)
        ["CRLF"]=>
        string(2) ”

        ["do_debug"]=>
        int(2)
        ["do_verp"]=>
        bool(false)
        ["smtp_conn:private"]=>
        int(0)
        ["error:private"]=>
        array(1) {
        ["error"]=>
        string(37) “Called Mail() without being connected”
        }
        ["helo_rply:private"]=>
        NULL
        }
        ["to:private"]=>
        array(1) {
        [0]=>
        array(2) {
        [0]=>
        string(29) “XXX@XXXXX.com”
        [1]=>
        string(0) “”
        }
        }
        ["cc:private"]=>
        array(0) {
        }
        ["bcc:private"]=>
        array(0) {
        }
        ["ReplyTo:private"]=>
        array(0) {
        }
        ["all_recipients:private"]=>
        array(1) {
        ["XXX@XXXXXXX.com"]=>
        bool(true)
        }
        ["attachment:private"]=>
        array(0) {
        }
        ["CustomHeader:private"]=>
        array(0) {
        }
        ["message_type:private"]=>
        string(5) “plain”
        ["boundary:private"]=>
        array(2) {
        [1]=>
        string(35) “b1_b8dd1d60d3991bc3835a0e8f2734d7d4″
        [2]=>
        string(35) “b2_b8dd1d60d3991bc3835a0e8f2734d7d4″
        }
        ["language:protected"]=>
        array(17) {
        ["provide_address"]=>
        string(54) “You must provide at least one recipient email address.”
        ["mailer_not_supported"]=>
        string(25) ” mailer is not supported.”
        ["execute"]=>
        string(19) “Could not execute: ”
        ["instantiate"]=>
        string(36) “Could not instantiate mail function.”
        ["authenticate"]=>
        string(35) “SMTP Error: Could not authenticate.”
        ["from_failed"]=>
        string(35) “The following From address failed: ”
        ["recipients_failed"]=>
        string(45) “SMTP Error: The following recipients failed: ”
        ["data_not_accepted"]=>
        string(30) “SMTP Error: Data not accepted.”
        ["connect_host"]=>
        string(43) “SMTP Error: Could not connect to SMTP host.”
        ["file_access"]=>
        string(23) “Could not access file: ”
        ["file_open"]=>
        string(33) “File Error: Could not open file: ”
        ["encoding"]=>
        string(18) “Unknown encoding: ”
        ["signing"]=>
        string(15) “Signing Error: ”
        ["smtp_error"]=>
        string(19) “SMTP server error: ”
        ["empty_message"]=>
        string(18) “Message body empty”
        ["invalid_address"]=>
        string(15) “Invalid address”
        ["variable_set"]=>
        string(30) “Cannot set or reset variable: ”
        }
        ["error_count:private"]=>
        int(1)
        ["sign_cert_file:private"]=>
        string(0) “”
        ["sign_key_file:private"]=>
        string(0) “”
        ["sign_key_pass:private"]=>
        string(0) “”
        ["exceptions:private"]=>
        bool(false)
        }
        The SMTP debugging output is shown below:

        SMTP -> FROM SERVER:

        SMTP -> NOTICE:
        EOF caught while checking if connectedThe following From address failed: XXXXXXX@XXXXXXXXXX.com

  23. Hello Callum,
    I’m new at the WordPress scene and I just got done putting my website together with the MySiteMyWay Myriad them for WP. Everything works fine, except for the contact forms, that freeze when you input Yahoo!Mail and Gmail e-mail addresses. I contacted the MySiteMyWay support team about it and they suggested that I install your WP SMTP Mail plugin, which I did. The issue remained, and they suggested that I contact my hosting provider so they could help me out configuring the SMTP correctly. They didn’t know/couldn’t help me. Would you be able to walk me through the configuration of the plugin? I’m a graphic designer, brand new to web and do not know how to code yet.
    Thank you for your attention!

      • Thank you for getting back to me. I just did it, but had no luck… I don’t know what to do anymore.

        • Your message contains absolutely zero actionable information, so there is precisely nothing I can do to assist you at this point. I recommend reading this for advice on how to ask for support in an actionable way in the open source space.

          • Try to find an answer by searching the archives of the forum you plan to post to.
            I did.

            Try to find an answer by searching the Web.
            I did.

            Try to find an answer by reading the manual.
            I did, at the WP site.

            Try to find an answer by reading a FAQ.
            I did.

            Try to find an answer by inspection or experimentation.
            I did.

            Try to find an answer by asking a skilled friend.
            I did.

            If you’re a programmer, try to find an answer by reading the source code.
            I’m not.

            I think your plugin is a great idea, but unfortunately I couldn’t make it work for me and nobody seems to able to help. My website’s contact forms don’t work.

            • For somebody to help you, you would need to tell them what is wrong. Simply saying “it does not work” gives one absolutely zero to work with.

              Please remember when asking for support of this kind that I wrote and published this plugin for free, and any support I provide is also free, in my own time. Approaching open source software with the attitude that you are being given a generous gift, without charge, will, in my experience, smooth your transactions.

              • Well, I thought I had explained everything on my original message. I know that your plugin is free and that you have nothing to do with my problem. Since nobody was able to figure out what was going on, I thought I would ask you for some help, but sorry for bothering you. I read all of my previous messages above and I sincerely cannot see what made you so upset. I asked for help, because I and the programmers I asked don’t know what’s going on, that’s all. I won’t bother you anymore.

                • This is precisely the sort of whining I’m referring to.

                  Your original message says “the contact forms, that freeze when you input Yahoo!Mail and Gmail e-mail addresses”. This is the only thing that even resembles an actual description of your problem, and it’s so unspecific as to be useless. Did you read the instructions here? Did you try sending a test message? What was the result?

                  Lose the self righteous, my life is so hard, whining attitude and I’m happy to help you as best I can.

  24. I think I’m hoping for something a little different than the comments above. I don’t want my server to be able to send any mail that doesn’t come from WP Mail SMTP or a similar plugin. The purpose is to avoid damage from a potential security hole that allows a malicious script to send spam from my server. What led me to this plugin is that I (mis)understood it replaces the php mail calls from WP.

    I’m not well-informed, so forgive any obvious stupidity. I want the WP outbound emailing plugin to work basically the same way an e-mail client does — which means I do not need to have an e-mail server of any kind functioning on the server, doesn’t it? With no e-mail server then my vulnerabilities would be limited to a script hacking the plugin itself, no?

    If I’m completely off track, please just say so or if there is any advice on how to achieve my purpose, it would be tremendously appreciated.

    • If you don’t have any way of sending mail from the server (so if PHP’s mail() doesn’t work for example) and you have WordPress send email via SMTP, then that will probably achieve your aims as I understand them. However, servers need to send notifications by email for all sorts of reasons, I would strongly discourage you from disabling all outgoing mail on the server unless you really know what you’re doing.

      • Thank you. That was a helpful response. I have done what I proposed and while WP is in fact sending mail quite fine, your caution is absolutely right because I note I am not receiving notices of cron jobs of which I would usually get six a day.

        For now I’m going to leave it alone and hope that important stuff finds its way into the log files just because of a recent malware attack that still has me paranoid.

        Thank you for the great plugin.

  25. After deleting this plugin i can’t send out emails from my blog. I get an error message :

    The e-mail could not be sent.
    Possible reason: your host may have disabled the mail() function…

    My host cant do anything for me. I don’t know what to do please help

    • If you have disabled the plugin, it will have no effect whatsoever on your WordPress installation. People have had issues like this before, in every case it turned out to be something that had changed on the host. Do you have root access to your server?

      If you want to delete the plugin directory (wp-content/plugins/wp-mail-smtp) the only thing left will be values on the wp_options table. If you want to delete those, you’ll find a list of them here.

      If you re-install the plugin and post an error message, I’d be happy to help you resolve the issues.

      • I assure you, emails were being sent and received just fine before installing the plugin. After deleting it i get the mail() error message i posted above. I followed the link you posted but couldn’t figure out which values to remove from wp_options. Which ones are they…Thanx, spence

        • To be clear, these options have no effect on the rest of the WordPress system while the plugin is not installed. You can remove them for the sake of completeness if you like, but they will not fix your problem. The values are listed in the link I sent, they start mail_ and smtp_. If you find those in wp_options, you can remove them, those are the only traces left of the plugin.

          • In that case, any advice would be highly appreciated. From experience, what issues should i be looking at specifically. If it helps, my wordpress site is running on bluehost. The support team have really gone above and beyond on this one, but to no avail.

            • Create a simple PHP file somewhere on your server with the following code < ?php var_dump(mail('youremail@domain.tld', 'Test email from PHP at ' . date('r'), 'Simple email test from the mail() function in PHP.')); ?>. Then load that file in your browser, and see what output you get and if the email arrives.

  26. How do i completely remove this plugin are there anymore files left in my database. I’ve just lost an entire day of my life trying to remedy this.

    • Return-path and Reply-to are not the same. Can you post a picture of the headers of the message you receive? What SMTP server are you using? I don’t see an mx for artisanexteriors.com so I’m not able to find your mail provider that way.

  27. I am using the Contact Form 7 plugin with your SMTP config plugin. I have it setup on WP Multisite 3.3 and it all works great. My only complaint is that all emails are noted as coming from the SMTP account that I’ve configured for your plugin. Is there anyway to get the web visitor’s email address to be parsed in the message as the From Email? I notice there is a setting to specify the from email in the config but it doesn’t state if there is a variable or short code that can be used.

    Please advise,
    CP

    • The plugin only modifies how mail is sent, and changes the from name / email if they are the default WordPress settings. So the functionality you describe is not supported. Also, some SMTP servers (gmail for example) forcibly change the from address to avoid being used for spamming.

  28. Thank you so much for this plugin! I’m trying to get it working in multisite, and I see in the notes that you recommend setting the values in wp-config.php for multisite installations.

    What exactly are the names of the variables I should set in order to configure this properly via wp-config.php?

    • If you look at the source of the plugin file you can copy and paste a section into wp-config.php then modify to suit your needs.

  29. Callum, thank you for a great plugin!
    It worked great until for a completely unrelated issue I had to address some spam issues on the same domain different website which resulted in me removing the remaining email account from server and turning on SPF (Sender Policy Framework) on.
    Shortly thereafter I noted that the WP site where your wonderful plugin was directing via SMTP of google was not able to send the FS Contact Forms anymore.

    I immediately turned of SPF, of as I noted that as the last and change but was not able to get it to authenticate. Double checked for typos but it ends up that it is not knocking on the SMTP from google’s door that I did configure.
    Instead I get an error from my host server regarding the authetication. How can I force it to go to SMTP.gmail.com for real again

    error message below
    The SMTP debugging output is shown below:

    SMTP -> FROM SERVER:220-panther.directrouter.co.uk ESMTP Exim 4.77 #2 Fri, 20 Apr 2012 21:18:31 +0000
    220-We do not authorize the use of this system to transport unsolicited,
    220 and/or bulk e-mail.

    SMTP -> FROM SERVER: 250-panther.directrouter.co.uk Hello panther.directrouter.co.uk [212.113.141.30]
    250-SIZE 52428800
    250-PIPELINING
    250-AUTH PLAIN LOGIN
    250 HELP

    SMTP -> ERROR: Password not accepted from server: 535 Incorrect authentication data

    • What port are you using? Some hosts filter outgoing traffic on port 25 to avoid spamming. If you’re specifying gmail’s smtp port, I can’t think why the traffic is ending up on a different server. Have your hosting provider had anything useful to say?

      • port 465. I am using exactly the settings of what Google (and others) prescribe for smtp. The host sadly gives me the closed door treatment… “Assistance with script / development related issues isn’t something that we offer” Which stinks as I believe it is related to the SPF that I temporarily turned on…. It appeared to have stopped working right then. Sorry to be knocking on your door with this but I hoped you had seen this before. Btw I did obviously test SMTP with same logon credentials via thunderbird client.

        And lastly WOW you are fast with your responses ;-)

        • Can you connect to this server over SSH? If you can, you could try connecting to the gmail smtp server and see if the connection is intercepted by your host. Likewise, you could verify that DNS is giving you valid entries on the server. You could try connecting to the server with the command `telnet smtp.gmail.com 465` if telnet is installed.

          If you want to ask your host, rather than describe the problem, you could simply ask “Does my hosting have unrestricted access to outgoing connections on ports 25 and 465?” Hopefully they’ll give you a straight answer on that, which tells you if they’re deliberately messing with the connection or not.

          • Host responded with this confirmation from server

            telnet smtp.gmail.com 465 Trying 173.194.67.108… Connected to smtp.gmail.com (173.194.67.108). Escape character is ‘^]’.
            Strange to me I assumed this was the issue

            • That looks like the connection is working properly. Can you pastebin the debug output from the test mail function? Do you have any other plugins active that might be affecting mail sending? If you try deactivating all other plugins do you get the same test mail output?

              • Hi Callum,
                I used your pastebin to get you the test mail output. (hope this reaches you if not I have the url)
                I did turn off all plugins and re-did the test. -same results-
                I very much appreciate your help on this one!
                Bart

  30. I am using the Contact Form 7 plugin with your SMTP config plugin. I have use this plugin to send email via Gmail. When I sent a test email, it worked But when I use actual contact form from website, it has an error message saying”Failed to send your message. Please try later or contact the administrator by another method.”
    I’m a newbie in wordpress and not a programmer so please be patient with me.
    Thank you so much for your time and help.

    • Are you testing to the same email address as the contact form is trying to send to? I’m not sure what that error message means, you might get more information from the contact form plugin. If the test message feature works, the WP Mail SMTP plugin should be working as expected.

    • Heads up there’s a password in that email which is in plain text. If that really is the password for that email account, it’s now publicly accessible on the web so I recommend you change it immediately.

      This is a truly interesting error, I’ve never seen anything like it. You’ve configured the plugin correctly, it’s attempting to connect to smtp.gmail.com and instead it’s landing on some other mail server. Do you recognise the mail server that it is connecting to? Is it the same ISP as your host maybe? The next thing to ask your host is whether or not DNS is being correctly resolved for smtp.gmail.com on that machine. It appeared like it was from the telnet connection, but somehow PHPMailer is attempting to reach smtp.gmail.com and instead is getting panther.directrouter.co.uk.

      I’m sorry I’m not able to offer more useful input on this one, it appears to be an issue on the server and I’m not certain where it lies. The plugin and WordPress appear to be operating correctly. Can you give me SSH access to the server? I can log in and try a couple of manual connects to see if that sheds any light on it. I can supply my public key, or if you want to give me a password please change it before *and* after my login.

      • Hi Callum, I notice the same on items you mentioned. I also informed the host of the same. And you are correct the server it connects with instead of smtp.gmail.com is indeed the server the site is hosted on.
        I once again asked for SSH access and will give you username and PW for this but I prefer this to be send via a private message to you. can you tell me how to reach you more privately?
        Thank you btw for your continued support on this !!!

        • Oh yes, the login info would need to be sent by email, not posted publicly. You can reply to the comment notification email and it will reach me.

          • hope it reached you. If I come up with anything new I will let you know. I am search for straws…

              • Yes I did. I even emailed this info to you a few days ago but it looks like it did not reach you. Anyway just send this again to you if you do not receive it please let me know. regards

                • I’ve logged into your server, generated a test message, and it was delivered successfully.

                  The mailer was set to PHP’s mail() and not SMTP. I ran some other tests and it appears that your host is intercepting any outgoing connections on port 25 or SSL on port 465, but only from PHP, not from the server itself. I’ve generated a file called ~/test-mail.php which shows this. If you log in via SSH and run php ~/test-mail.php you’ll see that it connects to the host’s mail server and not gmail. The code is very short, I recommend sending it to your host to explain the problem.

                  I changed the mailing method back to mail() so that messages will continue to send. As I was able to see your mysql and gmail passwords, I recommend you cycle them immediately. I recommend GRC’s excellent password generator.

                  • Callum, I just wanted to thank you one more time to help me bring this to a close. Your final test finally helped me convince the host that the issue was on their side. They in the end acknowledged that they had put a “spam prevention security measures on -their- our end”.

                    Cheers!

  31. Hi Callum-

    I’m building multi-site and per your instructions, pasted your code in my wp-config. I must have missed something simple, because I get this error:

    Parse error: syntax error, unexpected ‘@’ in /home/academy/public_html/wp-config.php on line 96

    I definitely have an @ symbol in my email addresses, so I don’t know what it wants. Here’s the code snippet from my wp-config file:

    define(‘WPMS_ON’, true);
    define(‘WPMS_MAIL_FROM’, ‘myemailaddy@gmail.com’);
    define(‘WPMS_MAIL_FROM_NAME’, ‘Todd’);
    define(‘WPMS_MAILER’, ‘smtp’);
    define(‘WPMS_SET_RETURN_PATH’, ‘false’);
    define(‘WPMS_SMTP_HOST’, ‘smtp.gmail.com’);
    define(‘WPMS_SMTP_PORT’, 465);
    define(‘WPMS_SSL’, ‘ssl’);
    define(‘WPMS_SMTP_AUTH’, true);
    define(‘WPMS_SMTP_USER’, ‘myemailaddy@gmail.com’);
    define(‘WPMS_SMTP_PASS’, ‘Password’);

    Do you know how I can fix that error and successfully use the plugin?

    -Todd

    • The code you pasted appears to use backticks ` instead of quotes (single ‘ or double “). Is that the issue? If you switch them all to single quotes, does it work? How did you copy / paste into wp-config.php? The code in the plugin file should not contain backticks, but maybe if you pasted somewhere else and are on Windows, the quotes got switched.

  32. Callum,

    First of all, thank you so much for your answer! I do appreciate your time!
    I do have testing to the same email address as the contact form is trying to send to. Please see below for the message from WP Mail SMTP when I sent out the test mail.

    Test Message Sent

    The result was:

    bool(true)
    The full debugging output is shown below:

    object(PHPMailer)#311 (53) {
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(0) “”
    ["From"]=>
    string(30) “wordpress@kourtneyereppert.com”
    ["FromName"]=>
    string(12) “Contact Form”
    ["Sender"]=>
    string(0) “”
    ["Subject"]=>
    string(47) “WP Mail SMTP: Test mail to janice@janicekim.net
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    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) “jkdesignwork12@gmail.com”
    ["Password"]=>
    string(8) “********”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    int(2)
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(9) “phpmailer”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["Version"]=>
    string(3) “5.1″
    ["smtp:private"]=>
    object(SMTP)#313 (7) {
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    int(2)
    ["do_verp"]=>
    bool(false)
    ["smtp_conn:private"]=>
    resource(182) of type (stream)
    ["error:private"]=>
    NULL
    ["helo_rply:private"]=>
    string(139) “250-mx.google.com at your service, [65.254.224.23]
    250-SIZE 35882577
    250-8BITMIME
    250-AUTH LOGIN PLAIN XOAUTH
    250 ENHANCEDSTATUSCODES

    }
    ["to:private"]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(20) “janice@janicekim.net”
    [1]=>
    string(0) “”
    }
    }
    ["cc:private"]=>
    array(0) {
    }
    ["bcc:private"]=>
    array(0) {
    }
    ["ReplyTo:private"]=>
    array(0) {
    }
    ["all_recipients:private"]=>
    array(1) {
    ["janice@janicekim.net"]=>
    bool(true)
    }
    ["attachment:private"]=>
    array(0) {
    }
    ["CustomHeader:private"]=>
    array(0) {
    }
    ["message_type:private"]=>
    string(5) “plain”
    ["boundary:private"]=>
    array(2) {
    [1]=>
    string(35) “b1_73c6684c0c35872fa7261ddce5357603″
    [2]=>
    string(35) “b2_73c6684c0c35872fa7261ddce5357603″
    }
    ["language:protected"]=>
    array(0) {
    }
    ["error_count:private"]=>
    int(0)
    ["sign_cert_file:private"]=>
    string(0) “”
    ["sign_key_file:private"]=>
    string(0) “”
    ["sign_key_pass:private"]=>
    string(0) “”
    ["exceptions:private"]=>
    bool(false)
    }
    The SMTP debugging output is shown below:

    SMTP -> FROM SERVER:220 mx.google.com ESMTP wd17sm23775170vdc.21

    SMTP -> FROM SERVER: 250-mx.google.com at your service, [65.254.224.23]
    250-SIZE 35882577
    250-8BITMIME
    250-AUTH LOGIN PLAIN XOAUTH
    250 ENHANCEDSTATUSCODES

    SMTP -> FROM SERVER:250 2.1.0 OK wd17sm23775170vdc.21

    SMTP -> FROM SERVER:250 2.1.5 OK wd17sm23775170vdc.21

    SMTP -> FROM SERVER:354 Go ahead wd17sm23775170vdc.21

    SMTP -> FROM SERVER:250 2.0.0 OK 1335155657 wd17sm23775170vdc.21
    ——————————————————————————————————

    This is the test email I received.
    (Subject: WP Mail SMTP: Test mail to janice@janicekim.net
    From: “Contact Form”
    Date: Mon, April 23, 2012 12:34 am
    To: janice@janicekim.net
    Priority: Normal
    Options: View Full Header | View Printable Version | Download this as a file | View Message details

    This is a test email generated by the WP Mail SMTP WordPress plugin.
    ————————————————————————————————-

    Thank you again for your help!

    • If the test mail is working correctly, then the plugin is working as expected, it appears the issue lies somewhere in the contact form plugin. I’ve heard reports of people successfully using Contact Form 7, but maybe something changed recently. Have you tried the Grunion Contact Form? It’s the one developed by the WordPress team and I’ve been using it for years alongside WP Mail SMTP without issue.

  33. Hello, in all the help requests in this thread, and in other places referencing this plugin, I keep seeing the reference to “SMTP debugging output”. Please tell me, where can I find this? Is it in a log file?

      • Ah, thank you. I’ve been having a problem with my outgoing emails being dissappeared by the Cloudmark spam filter, with no feedback, whenever I try to send an email containing an url, such as a registration email.

        I was hoping to at least get some feedback on this, but there’s no url in the test email, so I guess that’s out.

        On the plus side, I’ve realized that I can use my gmail account to send mail with this plugin, hopefully that will work out better.

        I was wondering though, is there any way to hack it so that it sends me a bcc, at least for registration emails? I’d really hate to have one of those get lost…

        • There is a WP Mail Log plugin which logs every mail that’s sent via wp_mail(). I don’t remember how much debugging info it saves though. It stores the data in a publicly accessible text file on the server, so I recommend using it for testing only.

          To add yourself as a BCC on all emails should be fairly easy. Check out the documentation for PHPMailer and look through the code to the point where it says something about adding your own options. That part is going to change in the next release so it’ll be easier to write a plugin rather than changing the plugin code, but if you’re after a hack today, that’s the place.

  34. Hello again, I have been trying to implement that using the Gmail SMTP project, but it isn’t working for some reason.

    The source for the test email using gmail is virtually identical to the one using the host’s smtp, and the debugging output from both have these lines:

    ["Host"]=>
    string(9) “localhost”
    ["Port"]=>
    int(25)
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(0) “”
    ["SMTPAuth"]=>
    bool(false)
    ["Username"]=>
    string(0) “”
    ["Password"]=>
    string(0) “”

    …when I know I changed the settings for port, username, password, etc.

    I am guessing this is a problem with my host, that they are overriding my settings somehow (I also don’t have any options listed under “Mailer” on the settings page where you are supposed to be able to enable phpmail), but I just wanted to double-check.

    • I didn’t fully understand your message. Have you selected SMTP as the mailer option? If not, the other settings may be ignored.

        • Very interesting. Are you using WordPress in a language other than English? Can you pastebin the HTML source of that page? I’m not sure what the issue here is, but I’m happy to try and figure it out, it’s not often that new issues are posted. :-)

          • It’s in English. I am a little uncomfortable putting all that in a public place (I still haven’t opened the site to the public), but I can show you this part right here:

            Mailer
            Mailer

            Send all WordPress emails via SMTP.

            Use the PHP mail() function to send emails.

            So it is still in the source. And just looking at it now, I see that:

            1 – If I delete ‘class=”screen-reader-text”‘ in the source and refresh, it suddenly appears, and

            2 – The use PHP mail() function option is in fact checked.

            So this just makes it all even weirder…

          • Sorry about that, I didn’t realize the code would not show. I just cut and pasted the table from your plugin, everything after that class= was invisible, I suspect a css display:none got put in somewhere, but I don’t have time today to go hunting.

            On the plus side, I was able to set it to smtp, and now using the google server works. This whole thing has just been damnably annoying, the tech support at my host has been less than useless on this…

  35. Hi, I have been using smtp mail on my wordpress sites ever since my host disabled php mail on the server. however I have never had the need for people to register to the site until now.
    The problem I have is that i have the smtp mail set up and working. contact form 7 works and the test email option in the wp-smtp mail setting page also works, however, when a user registers, the email with password is not sent, in addition when using the password recovery it throws the following message:
    your host may have disabled the mail() function
    which I know about but I thought this plugin bypasses all wordpress using this?

    Hope you can help.

    Phil

    • Can you try installing the WP Mail Log plugin and then see try one test message and one test registration. Maybe there’s a difference in the way the emails are being generated that will tell us where the problem lies.

    • Look at my comments above, my host has a spam filter set up to kill any email with an URL in it. So test emails went through, registration emails did not. No error message at all. Sounds like you may have the same problem.

  36. hi Callum,

    my error with this plugin is: Could not instantiate mail function.
    I’m using the php()mail function as my (free)host Byethost doesn’t allow SMTP sending.

    Below the error report. Can you please advice?

    The result was:

    bool(true)
    The full debugging output is shown below:

    object(PHPMailer)#222 (53) {
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(36) “Could not instantiate mail function.”
    ["From"]=>
    string(22) “info@ecounseling4u.com”
    ["FromName"]=>
    string(22) “info@ecounseling4u.com”
    ["Sender"]=>
    string(0) “”
    ["Subject"]=>
    string(50) “WP Mail SMTP: Test mail to ewout.bouwman@gmail.com
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “mail”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    string(0) “”
    ["Host"]=>
    string(9) “localhost”
    ["Port"]=>
    int(25)
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(false)
    ["Username"]=>
    string(0) “”
    ["Password"]=>
    string(0) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    int(2)
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(9) “phpmailer”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["Version"]=>
    string(3) “5.1″
    ["smtp:private"]=>
    NULL
    ["to:private"]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(23) “ewout.bouwman@gmail.com”
    [1]=>
    string(0) “”
    }
    }
    ["cc:private"]=>
    array(0) {
    }
    ["bcc:private"]=>
    array(0) {
    }
    ["ReplyTo:private"]=>
    array(0) {
    }
    ["all_recipients:private"]=>
    array(1) {
    ["ewout.bouwman@gmail.com"]=>
    bool(true)
    }
    ["attachment:private"]=>
    array(0) {
    }
    ["CustomHeader:private"]=>
    array(0) {
    }
    ["message_type:private"]=>
    string(5) “plain”
    ["boundary:private"]=>
    array(2) {
    [1]=>
    string(35) “b1_a314c94077188d29d6d36e7b9b56939c”
    [2]=>
    string(35) “b2_a314c94077188d29d6d36e7b9b56939c”
    }
    ["language:protected"]=>
    array(17) {
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: Data not accepted.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count:private"]=>
    int(1)
    ["sign_cert_file:private"]=>
    string(0) “”
    ["sign_key_file:private"]=>
    string(0) “”
    ["sign_key_pass:private"]=>
    string(0) “”
    ["exceptions:private"]=>
    bool(false)
    }
    The SMTP debugging output is shown below:

    Could not instantiate mail function.

    • Does mail work correctly with the plugin disabled? It might be that your host does not allow the from name / email to be changed, I’m not sure. This error means that there was a problem with PHP’s mail() function. If the issue still exists with the plugin disabled, I’d recommend contacting your host.

  37. Installed plugin WP-Mail-SMTP Version 0.9.1 (“Reconfigures the wp_mail() function to use SMTP instead of mail() and creates an options page to manage the settings”).

    I’m using smtp.gmail.com with the recommended settings, and it’s able to send a test email. That’s fine, but I’m having trouble translating that into where the email is actually being sent in the PHP program, which is called formprocessor2.php. I’ve seen the general recommendations to change mail() to wp_mail(), but I don’t really understand the specifics of how to do that. I did try changing the mail() command in formprocessor2.php to wp_mail() and got this error:
    Call to undefined function wp_mail() in C:\wamp\www\testsite\rosterform\formprocessor2.php on line 86

    Here is the PHP code that actually sends out the mail:

    `$headers = “MIME-Versin: 1.0\r\n” .
    “Content-type: text/plain; charset=ISO-8859-1; format=flowed\r\n” .
    “Content-Transfer-Encoding: 8bit\r\n” .
    “From: My Test Company \r\n” .
    “X-Mailer: PHP” . phpversion();

    //ini_set(“SMTP”,”mail.mytestcompany.com”); // Mail Server
    //ini_set(“smtp_port”, “25″); // SMTP Port
    //ini_set(“sendmail_from”, “mail@mytestcompany.com”); //return address

    $result = mail(implode(“,”, $recipients), $subject, $mail_body, $headers); //mail command`

    • This plugin only works within the WordPress environment. Does your script include WordPress at some point? It sounds like what you’re trying to do is outwith the scope of the support I provide here. If you’d like to discuss commercial development, let me know.

  38. Your plugin worked fine yesterday and I could send emails from localhost to my email accounts. Today I have the plugin “Fast Secure Contact Form” installed and emails are not sending anymore. The plugin “Fast Secure Contact Form” is removed, but I still get the ERROR:

    “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? (115825824)

    SMTP Error: Could not connect to SMTP host.

    How can I configure the email in PHP, to send email from youw plugin and mijn emailform?

    • It’s a PHP error, you’ll need to ask your host if fopen() has SSL support enabled. You could try disabling SSL and then see if it works, but that depends on whether your mailserver allows it or not.

  39. Installed plugin WP-Mail-SMTP Version 0.9.1 (“Reconfigures the wp_mail() function to use SMTP instead of mail() and creates an options page to manage the settings”).

    I’m using smtp.gmail.com with the recommended settings, and the plugin is able to send a test email from wp-admin. That’s fine, but I’m having trouble translating that into where the email is actually being sent in the PHP program, which is called formprocessor2.php. I’ve seen the general recommendations to change mail() to wp_mail(), but I don’t really understand the specifics of how to do that. I did try changing the mail() command in formprocessor2.php to wp_mail() and got this error:
    Call to undefined function wp_mail() in C:\wamp\www\testsite\rosterform\formprocessor2.php on line 86

    I do know the mail() command in the PHP program doesn’t seem to make use of your plugin (it just hangs when sending an email). The instructions say something about, “If you’re using plugins to send email…” but I’m not really using another plugin, just the mail() command, and I can’t figure out what I need to do to get it to use your plugin. Again, the plugin works fine from wp-admin.

  40. Hey hello I have installed the plugin
    Download Version 0.9.1

    I am using emember and I am not getting the emails sent from the emember so they told me to install your plugin but after installing and activating the plugin then going to the below link all I get is a blank page ???
    http://www.hitchingpostbrewing.com/wp-admin/options-general.php?page=wp-mail-smtp/wp_mail_smtp.php

    I have redownloaded the plugin, deleted the original reinstalled and the same problem, I am running wp Version 3.3.2, any thoughts on the problem would be great to get this fixed…

    Thanks TC

      • No I am not getting any error messages, I have provided a phpinfo page as the webite just will not seem to send mail .

        I would tell you your plugin is cool but I have not ever seen it yet LOL

        Thanks TC

        • If you’re getting a blank screen, that’s typically the “white screen of death”. There should be an error recorded in the PHP / web server logs, not visible on the page, but in the logs. You could also try setting WP_DEBUG to true in wp-config.php, that might output error messages on the page. I’d recommend switching it back after you see any errors, as it’s not sensible to leave it enabled all the time.

  41. I’m creating a WP multisite installation and have installed the plug-in setting in wp-config.php as you suggested. This seems to be working just fine. However, the Email menu still appears under Settings for each child site. Since I’ll be hosting the sites and need to control the email settings, I don’t want each site owner to see this option.

    I can work around this by removing the Email menu myself, but I think it would be more generally useful if you added a check in wp_mail_smtp_menus() to not add this menu when the settings are defined in wp-config.php.

    • Apologies, for some reason this comment slipped through my net. This is the default behaviour. Line 439 checks to see if we’re using constants from wp-config.php before enabling the options page. Is that not what you’re seeing? Do you have WPMS_ON defined to true?

  42. Hi
    I have spoken with my host which is jumpline.com and they said…”No, smtp is not blocked on the server. You can still use it in your domain. A path for smtp is, /usr/sbib/sendmail.”

    I have done 4 tests which are listed below.
    gmail to gmail – worked
    gmail to domain email – worked
    domain email to domain email – worked
    domain email to gmail – failed

    Please help.
    I have attached the 4 test results. I have replaced the email name and passwords to avoid spam.
    http://beatricekirton.com/WP-SMTP-TESTS/

    Regards.

    • I’m sorry, I don’t understand what your issue is. Is this in reply to an earlier comment? If you use the “reply to” links then I’ll see earlier messages.

      Using sendmail is not the same as using SMTP, so it sounds like your host has given you conflicting information in the same message.

  43. Hi Callum.
    Thanks for the great plugin I am using it on different blogs and directories. I however have on problem on my site. When a visitor to the directory sends an email via the directory to one of my clients on the directory the mail goes out and the client receives the mail. The “from email address” however is the one from the directory ( or the default email) and not this of the client. Now when the advertiser on the directory wants to reply to the email, by hitting the reply button on his email client the reply mail goes to the directory and not the person who sent the mail. Is there a way to work around this, so that the reply address will be the one of the person who sent the mail via the directory. Help is much appreciated.
    Regards Hanno

    • The plugin doesn’t change the reply-to address. I’d guess the issue lies in whatever plugin / code is generating the emails.

  44. Hey I’m using your plugin, and my “from” address is no-reply@etc.com, and using the proper smtp username/password the email is sent, but it’s received saying the sender was my personal email, and I don’t know what would cause this.

    • Is it a gmail / google apps account? I believe they automatically override the From address. It’s possible your mailserver also does the same. Is the username you’re personal email? If so, I’d guess that’s where it comes from. Have you set your personal email anywhere in WordPress? If not, then it’s definitely on the mail server. Try connecting to the mail server with a regular mail client (like Thunderbird) and sending an email, see if it works that way.

  45. hey,
    we have installed your plugin, and with one email it is working perfect but when we are trying to use our service mail (just anther mail of the site)
    we are getting this as a result:
    Test Message Sent

    The result was:

    bool(true)

    The full debugging output is shown below:

    object(PHPMailer)#100 (53) {
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["From"]=>
    string(22) “no-reply@affiliaXe.com”
    ["FromName"]=>
    string(22) “affiliaXe Notification”
    ["Sender"]=>
    string(22) “no-reply@affiliaXe.com”
    ["Subject"]=>
    string(47) “WP Mail SMTP: Test mail to rafael@affiliaxe.com
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    string(0) “”
    ["Host"]=>
    string(14) “smtp.gmail.com”
    ["Port"]=>
    string(3) “465″
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(true)
    ["Username"]=>
    string(22) “partners@affiliaXe.com”
    ["Password"]=>
    string(12) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    int(2)
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(9) “phpmailer”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["Version"]=>
    string(3) “5.1″
    ["smtp:private"]=>
    object(SMTP)#101 (7) {
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    int(2)
    ["do_verp"]=>
    bool(false)
    ["smtp_conn:private"]=>
    resource(134) of type (stream)
    ["error:private"]=>
    NULL
    ["helo_rply:private"]=>
    string(139) “250-mx.google.com at your service, [50.23.110.232]
    250-SIZE 35882577
    250-8BITMIME
    250-AUTH LOGIN PLAIN XOAUTH
    250 ENHANCEDSTATUSCODES

    }
    ["to:private"]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(20) “rafael@affiliaxe.com”
    [1]=>
    string(0) “”
    }
    }
    ["cc:private"]=>
    array(0) {
    }
    ["bcc:private"]=>
    array(0) {
    }
    ["ReplyTo:private"]=>
    array(0) {
    }
    ["all_recipients:private"]=>
    array(1) {
    ["rafael@affiliaxe.com"]=>
    bool(true)
    }
    ["attachment:private"]=>
    array(0) {
    }
    ["CustomHeader:private"]=>
    array(0) {
    }
    ["message_type:private"]=>
    string(5) “plain”
    ["boundary:private"]=>
    array(2) {
    [1]=>
    string(35) “b1_4e35948136df713bc22ca2607223b90d”
    [2]=>
    string(35) “b2_4e35948136df713bc22ca2607223b90d”
    }
    ["language:protected"]=>
    array(17) {
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: Data not accepted.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count:private"]=>
    int(1)
    ["sign_cert_file:private"]=>
    string(0) “”
    ["sign_key_file:private"]=>
    string(0) “”
    ["sign_key_pass:private"]=>
    string(0) “”
    ["exceptions:private"]=>
    bool(false)
    }

    The SMTP debugging output is shown below:

    SMTP -> FROM SERVER:220 mx.google.com ESMTP ch9sm34848140wib.8

    SMTP -> FROM SERVER: 250-mx.google.com at your service, [50.23.110.232]
    250-SIZE 35882577
    250-8BITMIME
    250-AUTH LOGIN PLAIN XOAUTH
    250 ENHANCEDSTATUSCODES

    SMTP -> ERROR: Password not accepted from server: 535-5.7.1 Please log in with your web browser and then try again. Learn more at
    535 5.7.1 https://support.google.com/mail/bin/answer.py?answer=78754 ch9sm34848140wib.8

    SMTP -> FROM SERVER:250 2.1.5 Flushed ch9sm34848140wib.8

    SMTP Error: Could not authenticate.

    NOTE: that i can login into the email account with the same user name and password. this was checked several times, and then again when entering a different user email and password it des work.
    please advise
    you can reach me at itamar [at] affiliaxe.c o om

        • Your account username and password were pasted in plain text in the debugging output you posted. I recommend you change that password immediately anywhere that you were using it. I have removed it now, but it was live for some time, and it’s known at least to me.

          My question was not whether or not you had followed the instructions, but what the page says. The issue appears to be that your mail server is not accepting your password. That’s outside the scope of this plugin. I’d suggest you contact your mail provider and ask them what they can do to help debug this issue. I know many users are able to use the plugin with gmail, so they are compatible.

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>