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: Current Version: 0.7, Released 01/May/2008
Update: To make support a little more manageable, I’ve closed the comments on this post. Please post support questions here instead. That way I can separate support by each plugin version.
Changelog
0.7 - Added checks to only override the default from name / email
0.6 - Added additional SMTP debugging output
0.5.2 - Fixed a pre 2.3 bug to do with mail from
0.5.1 - Added a check to display a warning on versions prior to 2.3
0.5.0 - Upgraded to match 2.3 filters which add a second filter for from name
0.4.2 - Fixed a bug in 0.4.1 and added more debugging output
0.4.1 - Added $phpmailer->ErroInfo to the test mail output
0.4 - Added the ability to send a test email
0.3.2 - Changed to use register_activation_hook for greater compatability
0.3.1 - Added readme for WP-Plugins.org compatability
0.3 - Various bugfixes and added From options
0.2 - Reworked approach as suggested by westi, added options page
0.1 - Initial approach, copying the wp_mail function and replacing it
Troubleshooting
Cannot load wp_mail_smtp2Fwp_mail_smtp.php
Updated 26/Sep/2007: This is a bug in WordPress core to do with redirection. We’re looking into the problem and hope to find a solution soon. It’s purely a cosmetic problem when you click “Update Options”. The options are saved properly, but the page doesn’t redirect. Everything will work fine, you just won’t see the “Options Saved” message.
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!)
Other Problems
Try sending a test email. The error message should help you detect your problem.
SSL
The PHPMailer class doesn’t support SSL or TLS. The Swift SMTP and plugin includes the more modern SwiftMailer class which has this feature.
Oops… Something is wrong with the file!
@s1mone: Woops, you’re dead right. I’ve updated the link, now it should download ok. Thanks for pointing that out.
Hi there,
Just the mod I’m looking for..
What port have you used for SSL authenticated mail ?
Trying to use it with gmail on smtp port 465
@Dorian: I haven’t configured it to use SSL authenticated mail, although that does seem like a sensible option. I’ll look into adding those options.
Hello,
This is the message I get when I hit the update button, no matter what the selection:
“Cannot load wp_mail_smtp2Fwp_mail_smtp.php.”
Please advise.
@NetGirl: You get that message when you click “Update Options” right? That’s an error because of the way your data is submitted to WordPress. It could be a server or browser issue, but if your other options pages all work, I’m not sure what’s causing it. Can you give me a couple of screenshots? Are you running on Windows / Linux hosting? Anything else you think might be relevant?
I was hoping this would solve my problem, but no dice. I tried it with authentication and without and got nada.
Sorry, meant to add that I’m using WP 2.2.1
@lynn: Can you give me a bit more info as to the problem? Are you seeing any error messages?
All:
Callum is da man. He totally figured out what the problem was and then even helped me with another mail plugin that was having problems.
Awesomely awesome and many thanks,
lynn
Cannot load wp_mail_smtp2Fwp_mail_smtp.php
Could you share the solution with the rest of us?
Getting the same error
IIs 6.0 / Windows 2003
PHP 5
Cannot load wp_mail_smtp2Fwp_mail_smtp.php
@Draft, TopCat & NetGirl: I believe the problem was fixed in version 0.3.2. It was a bug to do with forward slashes on *nix and back slashes on Windows. Let me know if you have the same problem with 0.3.2 or later.
Sorry for the slow response.
Yes, it still produces the same error on Windows Server:
Running Ver. 0.3.2.
Cannot load wp-mail-smtp2Fwp_mail_smtp.php.
I also get that error on version 0.3.2 with WP 2.2.3.
=====
Cannot load wp-mail-smtp2Fwp_mail_smtp.php.
=====
It appears on IE7 and FireFox. Server is located on ovh.org but I am not sute what is the platform. I suppose that some linux distribution.
The same error appeared on my own ubuntu-debian server.
Mentioned error message appears but system sends emails correctly
The error message cannot find “wp-mail-smtp2Fwp_mail_smtp.php” is a redirection bug in WordPress. It’s something in WordPress core.
It should only appear when you click “Update Options”. The options are updated and saved, but the error message appears instead of being redirected to the correct page.
Until the bug is fixed in WordPress core, users will have to put up with the problem I’m afraid. It’s purely cosmetic, the plugin still functions as it should do. Hopefully we’ll fix it in WordPress core soon.
Hi there,
I have read all of these comments and I can not seem to match them up with my issue. When I set the plugin to utilize SMTP, I get no emails whatsoever. I have tested it a variety of different ways:
With From email, Empty From email, mail server named address, mail server IP address, with Auth, without Auth. And all combinations of the above. Nothing seems to work. I’m not sure where to look for errors but I noticed that there is NO attempt to login by the username I specified. Essentially, mail just stops working when I turn on SMTP. Any thoughts?
PS - thank you for donating this plugin. It is very useful (or will be).
0.3.2 seems to be working well with me on WP 2.3, including SMTP AUTH. But my host would like me to use TLS for added security. Would that be an easy thing to add, as a new feature? I suppose that depends whether PHPMailer supports TLS, and I can’t see any sign that it does.
@Peter Kirk: I don’t think the PHPMailer class supports SSL. If you want SSL support the Swift SMTP plugin might work for you. It uses the newer SwiftMailer class which I believe does support SSL / TLS.
Thanks, Callum. Unfortunately Swift SMTP doesn’t seem to be working for me, and there has been no response for several months to the thread in their support forum about the error I have encountered. I appreciate your much faster response!
@Tai Graham: I’m not sure what’s causing the issue. It’s hard to debug the problem because there’s no error messages. I think it could be to do with security settings on your server that prevents PHP being able to open a remote connection. If that is the case, unless you can change server settings you won’t be able to send mail via SMTP. You could try the Swift SMTP plugin, if that doesn’t work, it’s probably a server problem.
My host reminds me that using SMTP AUTH without TLS or SSL is a security problem as the password is transmitted across the Internet in plain text. That means that spammer who intercepts this password can hijack the SMTP server as a spam source. Not a good idea.
My host also helped me discover my problem with Swift SMTP. I was asked to use TLS on port 25 of the host’s mailserver, a separate system from where my blog is hosted. But Swift has some deliberate code written so that if port 25 is selected the host name is set to “localhost” and TLS and SSL are disabled. My host tells me that although SSL should be on port 465, it is correct according to rfc2487 for TLS to be on port 25.
One advantage of Swift is that it lets you send a test message and displays any error reports. You might want to add that facility as it would help you debug problems like Tai’s.
@Peter Kirk: Thanks for posting back the details. That’s an interesting idea, sending a test mail, I think it would work. I tried adding a debugging option, but that doesn’t work.
Who is your hosting company? They sound great!
I tried Cimy Swift SMTP for WordPress, a variant of the other one I tried, and that seems to have solved my problem.
My hosting is currently with BCISGnet, with whom I have a special non-commercial arrangement. They are very security conscious - as I need to be for some things I do, although not for my blog.
I’ve added the ability to send a test email and released the updated plugin as version 0.4. I’ve updated the code on WordPress.org, so automatic updates should be notified in a day or two.
Just downloaded and installed WP-Mail-SMTP 0.4 on 10/10/2007. I installed on Wordpress 2.3, configured for SMTP w/ Auth pointing to my hosting provider SMTP server and sent the test message smooth as grease. Thanks so much…
Just a quick follow-up. I forgot to mention I’m running WordPress 2.3 locally on a laptop with Windows XP SP2, Apache 2.2.4, PHP 5.2.4 and MySQL 5.0.45. You’d stated you didn’t test the AUTH feature, so with this you’ll have an environment that you can certify as working…
@Max: Great, thanks for the feedback, nice to know it’s working for you.
Hello and thanks for this plugin.
When I try to send a test email I get:
Test Message Sent
The result was:
bool(false)
Any suggestions on how to troubleshoot this?
@smelmoth: Try using version 0.4.1, I’ve added more debugging output to the test email function. Hopefully that will shed some more light on the problem.
Hi,
I was having terrible problems with WordPress just not sending any emails, then I came across your plugin. It seems to work (only just begun to test it), so thank you very much for that!
I also get the cannot load message, but I also notice that the “From:” user I set in the options page is not being used. The options page displays it correctly, but still Wordpress is sending from the default user wordpress@domainname.
Any ideas?
@YikYak: Aha, there’s a change to the way the mail from is handled in WordPress version 2.3. I’ve updated the plugin to reflect the two new filters, it should work if you download the latest version (0.5.0). Let me know if you have any other problems.
Great plugin Callum. I am going to try it out right now and provide a feedback once I am done molesting it
Hi thanks for this plugin. I was really wondering what was wrong with my comment notifications. But when I installed this and set it to SMTP, it worked again.
Thank you very much!
Allen
Thank you Callum! I have been going crazy all night trying to figure out why users aren’t getting registration or password retrieval e-mails (I’m on WP 2.3.1). Your plugin fixed my problem, but only if I specified an e-mail in the “From Email” field (Options->Email after activating the plugin). If I leave that field blank, the test e-mail fails.
@Moncef: Check out your admin email, is that a valid email address? The plugin defaults to the admin email if you leave the From field blank, so perhaps that’s where the problem lies. If the test mail fails, you should get a pretty comprehensive debugging output from the PHPMailer class, which will hopefully shed some light on the problem.
Bottom line, glad it’s working!
hi Dear
dos not Work??
Why ?? why ??
hi
dose not work , Way??
>>>>>>>>>>>>>>>>>if(function_exists(’load_plugin_textdomain’))
load_plugin_textdomain(’wp-mail-smtp’,'wp-content/plugins/wp-mail-smtp’);<<<<<<<<>
>> load_plugin_textdomain (plugin-name) <<
@zxo003: That code does not appear within the WP Mail SMTP plugin. I’m guessing you’re using another plugin for language translation, as that code is also not in WP core. Try deactivating your other plugins and then see if WP Mail SMTP works on its own. If it does, re-activate your plugins one at a time to find the problem.
hi
thanks !! thanks !!
bay
Hi.
I’ve got some problems with sending emails, so i tried your plugin.
I’ve got installed it and after have configured all data, i test sending a mail but i’ve got an error :
The result was:
bool(false)
And the “!” is on the line :
["SMTPKeepAlive"]=>
bool(false)
! ["smtp"]=>
&object(smtp)(6) {
["SMTP_PORT"]=>
int(25)
["CRLF"]=>
string(2) ”
Please help me, i don’t know what to do.
Thank you very much, and sorry for my english.
@ADR: Can you post the error message line from the debug output? The error message will hopefully tell you where the problem lies.
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
@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.
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
}
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!
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
@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.
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?
@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.
i set everything but i get bool(false)
and this error message
string(75) “Language string failed to load: recipients_failedmytestemail@address.com”
what happen?
thanks a lot!
Awesome plugen mate!
Just what I was looking for to circumvent may hosts ban on phpmail().
Works great!
//Static
I can’t seem to save the options using WordPress MU. Any ideas?
WordPress MU recently changed the way options are handled. If you’re running a version of MU later than r1188 that will be your problem. If not, you’d need to give me more information to be able to help.
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)”
@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?
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
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!
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!
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!
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,
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.
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
Some encoding problems with chineses char. Is it a client side problem?
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.
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.
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.
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.
I use this wp-mail and I must say. This is fantastic things, I work for it and this is work very well
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
@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.
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:
By the way, I noticed that I left the password in the debugging info! I just changed the password…
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!
@Gilbert: The problem is this line in your SMTP log:
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!)