WP Mail SMTP

This WordPress plugin reconfigures the wp_mail() function so all mail from your blog can be sent by SMTP instead of using PHP’s mail() function. The plugin also adds an Options > Email page which allows you to configure the settings from the admin interface of your site.

Download the plugin from wordpress.org.

Troubleshooting

Could not connect to host

If you see an error like “Failed to connect to server”, the plugin is working, PHP cannot connect to the server. Look at the whole error message and investigate from there. Check your php.ini settings around fopen() permissions, check your SMTP host is correct, or contact your server administrator.

If your error is “Cannot connect to host”, please look for support elsewhere, please do not ask for support here. These questions have been asked many times before, please search the history. The plugin is working, the issue lies elsewhere.

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

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!)

Translatiion

If you would like to translate this plugin, you can download the POT file here.

Other Problems

Try sending a test email. The error message should help you detect your problem.

Support: Post questions here

Multi Site

This plugin was compatible with WordPressMU back in the day. I recommend if using the plugin on a multi-site setup, put your settings in wp-config.php and then disable the admin menu. This means you can set options once that will apply to all sites in your network. Allowing each site to set their own options is also possible, but might lead to unexpected results, and potentially, many more support requests.

Changelog

See the changelog on wordpress.org.

106 thoughts on “WP Mail SMTP

  1. @ADR: Can you post the error message line from the debug output? The error message will hopefully tell you where the problem lies.

  2. WOW.. Thank you. Yoru plugin worked !!

    I am not a PHP guru but as an engineer have good enough intutive skils to dig around code.

    How can I cutomize the emails that are being send with the user name & password.

    I just want to add some more welcome text to be polite rather tahn just the username & password. Where in the code can I do it ?

    Any help please

  3. @Henry: The plugin hooks into the function wp_mail(). So look for all instances of “wp_mail” in the code and you’ll find all the places where emails are sent. There may be a hook or filter you can use to change the text of the emails. If you’d like my professional help, contact me to discuss.

  4. Pingback: WordPress新用户注册收不到邮件! - CutDeer De Blog

  5. Pingback: Wordpress 2.3.1 not sending emails error | Silkenhut's World

  6. I simply cannot get it to work. I have tried numerous settings and all test emails fail. bool(false)

    I even tried with the gmail smtp server and no dice:

    object(SMTP)#132 (6) {
    [“SMTP_PORT”]=>
    int(25)
    [“CRLF”]=>
    string(2) ”

    [“do_debug”]=>
    bool(false)
    [“smtp_conn”]=>
    bool(false)
    [“error”]=>
    array(3) {
    [“error”]=>
    string(27) “Failed to connect to server”
    [“errno”]=>
    int(111)
    [“errstr”]=>
    string(18) “Connection refused”
    }
    [“helo_rply”]=>
    NULL
    }

  7. I was having a problem with the Workpress site for my ADDON domain (only). Emails are not being received by those who register at my WordPress blog. There are no errors in the registration process, and the new user appears in the WordPress user admin panel. The email password is just not being sent. (I’ve tested with my own email accounts, and it’s not a spam issue).
    I created a wordpress@myaddondomain.com, and wordpress@myaddondomain.myprimarydomain.com , which was suggested on another site. Nothing worked.

    I added your plugin and LIFE IS SWEET. Thanks!

  8. Everything works fine except when the e-mail is sent it does not include a password or a verification link. So if I try to register with the test username and password I created earlier, it says invalid username or password.

    I too, love this plug in. I have wrestled for weeks with the php mail and accomplished nothing. I was so happy when my text came through – but alas no registration link or password.

    Can you help?

    Thanks so much

  9. @Carol: I’m not sure why the emails don’t include the links. Are they being sent without the links, or just not sent at all? It sounds like a WordPress problem, are you running the very latest version? Right now that’s 2.3.2.

  10. I get the following error when sending emails from my home hosted wordpress:

    (host a.mx.mail.yahoo.com[209.191.118.103] refused to talk to me: 553 Mail from xx.xx.xx.xx not allowed – 5.7.1 [23] Connections not accepted from IP addresses on Spamhaus XBL; see http://postmaster.yahoo.com/550571-2.html [550])

    It looks like a spam issue and happens with gmail and yahoo recepients. Any ideas what’s going on?

  11. @Igor: The error means that you can’t send mail from your domestic internet IP address because it’s suspected as spam. Instead, try setting your SMTP host to be your ISP’s mail server. That will normally work.

  12. Pingback: Problemas con los emails en Wordpress | Punto Geek

  13. Pingback: Wordpress y un plugin para casi todo | MP3d - Posicionamiento Seo y Adsense

  14. Awesome plugen mate!

    Just what I was looking for to circumvent may hosts ban on phpmail().

    Works great!

    //Static

  15. Pingback: thomas lamsfuß » Blog Archive » Post Notification, Similar Posts, WP-Mail-SMTP

  16. THANK YOU for this plugin, it fixed my new register and lost password emailer problem quick.

    I did a test register and got the e-mail but there’s a misspelling in the e-mail’s header, is this in your plugin or somewhere else? Where would I edit this at? It misspelled “infomation”

    “Your register infomation from (my site blah blah)”

  17. @Nate: The plugin doesn’t add any text to the email itself, so any spelling errors would be as a result of either a misspelling in some settings, or a bug in a plugin or WordPress. Can you forward me a copy of the whole email to see what you mean?

  18. Pingback: SixSigns Blog » Blog Archive » Blog of SixSigns

  19. Hello,

    I tried the plugin today, first I got the same error message like Angelo mentinoed before:

    string(75) “Language string failed to load: recipients_failed”

    Now, after reconfiguration I get the error

    [“ErrorInfo”]=> string(43) “Language string failed to load: instantiate”

    Does anyone have an idea for a solution?

    Thank you,
    Jens

  20. Pingback: WP Plugin Archive » WP Mail SMTP

  21. Yep, I get the same message! Language string failed to load: instantiate

    I would put here the entire log if that helped..Thanks for the plugin and help!

  22. Argh. There does seem to be a recurring problem with this language string thing. I’ll get into it soon. I can’t ignore it any longer! :)

  23. Hi,

    I’ve installed WP Mail SMTP, but for some reason it does not work when an email is sent to a hotmail address…

    I use STMP without authentification and send out a test email. When I send it to my yahoo account it works fine, but when I send it to my hotmail it doesn’t…ANy ideas on how I could fix this?

    Thank you!

  24. Hello,

    I just installed this plug-in today and it seems to be a little flakey when sending out new registration emails. I am running WordPress 2.5 and have no other email plug-ins installed.

    My problem is similar to that of Yannick. When I register a user using a gmail account then the administrator receives his email AND the newly registered user receives their email including their password. However, whenever a new user registers using a hotmail or yahoo address, the admin still receives his email fine, BUT the user never receives the email stating their password.

    I am not using the SMTP authentication either, as i´m not entirely sure what it is asking for in those two fields.

    Is there something else I need to do to enable other accounts to receive their passwords?

    Thanks,

  25. Callum,
    Do you know if there are any bugs with this plugin using it wp 2.5?

    I would like to upgrade but am extremely hesitant.

  26. I just installed this, and got the dreaded message upon sending a test message to an email address not in my own domain:

    The full debugging output is shown below:

    object(PHPMailer)#108 (39) {
    [“Priority”]=>
    int(3)
    [“CharSet”]=>
    string(5) “UTF-8″
    [“ContentType”]=>
    string(10) “text/plain”
    [“Encoding”]=>
    string(4) “8bit”
    [“ErrorInfo”]=>
    string(69) “Language string failed to load: recipients_failedphoneyname@phoneydomain.com

    Any hints on how to work around this?

    Many Thanks!

    -Deb

  27. What a great and helpful posting … I was just putting up WordPress for a client on an IIS box with PHP 5 and MySQL 5, and couldn’t quite get the SMTP thing working properly via PHP. Your plugin was a snap. thanks a lot.

  28. I have released a new version of the plugin with additional debugging output. If you were previously having problems, please try this new version and then send me the SMTP debugging output. Please note, I’ll now only respond to questions about version 0.6, so if you’re still waiting for an answer to an old question, please upgrade, test again, and let me know if you’re still having issues. :)

  29. Pingback: WP Mail SMTP v0.6 released at Callum Macdonald

  30. Further update, I’ve released version 0.7 which will only change the from name and email if they are the defaults. Previously the plugin would modify these even if they had been specifically set by WordPress or another plugin. I recommend everyone upgrade to 0.7.

  31. My problem was that for chinese characteres we can see only question tags like this:

    ???? ?????????? ???? ???? ?????

    I think it is a problem with bad webmail like hotmail who cannot manage correctly UTF-8 encoding, I solved it by using the php funtion htmlentities() and evrerything is OK now.

    Thanks for your reply.

  32. I use this wp-mail and I must say. This is fantastic things, I work for it and this is work very well

  33. Unfortunately, I am still having the same issue. I don’t get any errors or anything and the test email says success to all three types of email addresses that I have tried. The confirmation emails just never arrive if I use any address other than one that ends with @gmail.com.

    I’ve tried Yahoo and Hotmail emails and neither of them get their confirmation emails, however, the admin email receives the email immediately about a new user registering.

    The GMail accounts are also the only ones that receive the test email if I send them out.

    Am I just overlooking something here?

    Thanks :)

  34. @Jerod: Try sending a test email to a Yahoo and Hotmail address, and then email me the output of the SMTP debug. It might be something to do with your mail server.

  35. Hi,

    I’m having problems with your plugin. The concept is great, but it doesn’t seem to work. I updated to 0.7 and tested it with a yahoo address and it sent the test email. Then I tried another email address and I got an error. So I tried the yahoo address again, and this time an error came up!

    Here’s the output of the error:

    Test Message Sent

    The result was:

    bool(false)

    The full debugging output is shown below:

    object(phpmailer)(39) {
      ["Priority"]=>
      int(3)
      ["CharSet"]=>
      string(5) "UTF-8"
      ["ContentType"]=>
      string(10) "text/plain"
      ["Encoding"]=>
      string(4) "8bit"
      ["ErrorInfo"]=>
      string(64) "Language string failed to load: from_failedadmin[at]blog.sfmoma.org"
      ["From"]=>
      string(21) "admin[at]blog.sfmoma.org"
      ["FromName"]=>
      string(17) "SFMOMA blog admin"
      ["Sender"]=>
      string(0) ""
      ["Subject"]=>
      string(45) "WP Mail SMTP: Test mail to hellvert[at]yahoo.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) ""
      ["Version"]=>
      string(4) "1.73"
      ["ConfirmReadingTo"]=>
      string(0) ""
      ["Hostname"]=>
      string(0) ""
      ["Host"]=>
      string(20) "mail.blog.sfmoma.org"
      ["Port"]=>
      int(25)
      ["Helo"]=>
      string(0) ""
      ["SMTPAuth"]=>
      bool(true)
      ["Username"]=>
      string(21) "admin[at]blog.sfmoma.org"
      ["Password"]=>
      string(8) "######"
      ["Timeout"]=>
      int(10)
      ["SMTPDebug"]=>
      int(2)
      ["SMTPKeepAlive"]=>
      bool(false)
      ["smtp"]=>
      &object(smtp)(6) {
        ["SMTP_PORT"]=>
        int(25)
        ["CRLF"]=>
        string(2) "
    "
        ["do_debug"]=>
        int(2)
        ["smtp_conn"]=>
        int(0)
        ["error"]=>
        array(1) {
          ["error"]=>
          string(38) "Called Reset() without being connected"
        }
        ["helo_rply"]=>
        NULL
      }
      ["to"]=>
      array(1) {
        [0]=>
        array(2) {
          [0]=>
          string(18) "hellvert[at]yahoo.com"
          [1]=>
          string(0) ""
        }
      }
      ["cc"]=>
      array(0) {
      }
      ["bcc"]=>
      array(0) {
      }
      ["ReplyTo"]=>
      array(0) {
      }
      ["attachment"]=>
      array(0) {
      }
      ["CustomHeader"]=>
      array(0) {
      }
      ["message_type"]=>
      string(5) "plain"
      ["boundary"]=>
      array(2) {
        [1]=>
        string(35) "b1_d9a1bc908e49f6a0bc947cc1d18305d8"
        [2]=>
        string(35) "b2_d9a1bc908e49f6a0bc947cc1d18305d8"
      }
      ["language"]=>
      array(0) {
      }
      ["error_count"]=>
      int(4)
      ["LE"]=>
      string(1) "
    "
    }

    The SMTP debugging output is shown below:

    SMTP -> FROM SERVER:
    421 cl21.gs01.gridserver.com: Too much load; please try again later
    SMTP -> FROM SERVER: 
    SMTP -> ERROR: EHLO not accepted from server: 
    SMTP -> FROM SERVER: 
    SMTP -> ERROR: HELO not accepted from server: 
    SMTP -> ERROR: AUTH not accepted from server: 
    SMTP -> NOTICE:
    EOF caught while checking if connected
  36. By the way, I noticed that I left the password in the debugging info! I just changed the password… ;)

  37. So I clicked the radio button to switch from smtp to php mail() :

    * Use the PHP mail() function to send emails.

    Now I don’t seem to be getting any error messages! I sent a couple of test emails and they all worked!

    However, I tried registering on my blog with a yahoo email address and I never received the confirmation email with the user password. I tried registering with other email including gmail accounts and the confirmation emails came through.

    What’s up with yahoo?

    Thanks for working on these problems. I appreciate it very much!

  38. @Gilbert: The problem is this line in your SMTP log:

    421 cl21.gs01.gridserver.com: Too much load; please try again later

    It seems your mail server is too busy to deal with you! What about if you try setting the mail to send by SMTP but to localhost with no authentication? Does that work? Are you on a shared hosting server? Most shared hosting normally have web and mail on the same box, so SMTP to localhost usually works fine.

    (I removed your password and obfuscated your email, hopefully you’ll get a little less spam!)

  39. Pingback: WP Mail SMTP v0.7 at Callum Macdonald

  40. Pingback: 关于《低調人生》所使用的wp插件 » 低調人生

  41. Pingback: En Route Solutions | your host may have disabled the mail() function…

  42. Pingback: WordPress auf einem Ubuntu-Server » ubuntublog.ch

  43. Pingback: Semi-random thoughts and musings » Long time working this one out

  44. Pingback: Registrering… at Elin William Andreas Åsa [ewaa]

  45. Pingback: 我所使用的Wordpress插件 | Road of e4

  46. Pingback: Post Notification - מדריך לבלוגר » משתמש כבד

Comments are closed.