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

847 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?

  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.

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>