WPForms Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

how to set up WordPress SMTP

How to Get WordPress Form Notifications Using the WP Mail SMTP Plugin

by Shahzad Saeed on Mar 2, 2017

Are you not receiving email notifications from your WordPress contact forms? You can fix this issue and start receiving notifications by setting up Simple Mail Transfer Protocol (SMTP) on your site. In this article, we’ll show you how to start receiving email notifications from WordPress contact forms using your Gmail, Yahoo or Microsoft Live/Hotmail/Outlook email account.

Why You’re Not Receiving Notifications

There can be a lot of reasons behind the lack of email notifications. Here are a couple of the most common:

  • Your WordPress hosting server is not configured to use the PHP mail function that WordPress uses to send emails that are generated by a contact form plugin like WPForms.
  • To reduce spam emails, your email provider often checks whether your email is originating from the location it claims to be originating from. For example, if your email server is yahoo.com, chances are your form notification won’t even make into the spam folder since they are sent out from a completely different server.

This is why we recommend using SMTP to send emails from WordPress instead of using the default PHP mail function. SMTP (Simple Mail Transfer Protocol) is an industry standard way to send emails that use proper authentication method to ensure email deliverability.

In this post, we’ll be using the free WP Mail SMTP plugin to send form notifications using your Gmail, Yahoo, or Live (including Live, Outlook, and Hotmail) email account.

Note: This tutorial’s method is less secure because it stores your email login and password in your WordPress dashboard. Other WordPress administrators have access to this. For a more secure option, we recommend setting up SMTP with SendGrid.

Step 1: Install the WP Mail SMTP Plugin

The first thing you need to do is to install and activate the WP Mail SMTP plugin. You can see this guide on how to install a WordPress plugin for step-by-step instructions.

Step 2: Enter Advanced Email Options

Upon activation, you’ll need to visit the Settings » WP Mail SMTP page to configure the plugin settings.

WP Mail SMTP Advanced Email Options

Here, you’ll be asked to enter your From Email. This is the email address that your form’s email notification should be sent from.

Note: Make sure to enter the same email address you will be using to send SMTP emails (your Yahoo, Gmail, or Live email address). Additionally, in WPForms, the same email must be used in the From Email setting in your form notifications.

If you want, you can enter the From Name as well. If you leave it blank, the from name in your form’s email notification will be shown as WordPress.

Then, you’ll need to configure the Mailer settings. Choose Send all WordPress emails via SMTP.

You can also enable return path by selecting the Return Path checkbox. The return path is the address to which any undeliverable message notices, usually known as bounces are sent. By enabling the return path, those emails will be sent to the email address you entered in the From Email field above.

When you’re done, click Save Changes.

Step 3: Enter SMTP Options

After saving your Advanced Email Options, just scroll down the page to see SMTP Options.

Each email provider requires slightly different SMTP Options configurations. Let’s take a look at how to configure it for different email providers including Gmail, Yahoo and Live/Hotmail/Outlook.

Gmail SMTP Options

If you want to send notifications using your Gmail account, you can use the below SMTP options.

gmail smtp options in wp mail smtp

  • SMTP Host: smtp.gmail.com
  • SMTP Port: 465
  • Encryption: Use SSL encryption
  • Authentication: Yes: Use SMTP authentication.

Then, enter your Gmail username and password and click Save Changes.

Yahoo SMTP Options

If you want to send notifications using your Yahoo email, you can use the below SMTP options.

yahoo smtp options in wp mail smtp

  • SMTP Host: smtp.mail.yahoo.com
  • SMTP Port: 465
  • Encryption: Use SSL encryption
  • Authentication: Yes: Use SMTP authentication.

Then, enter your Yahoo username and password and click Save Changes.

Live, Hotmail or Outlook SMTP Options

If you want to send notifications using your Live, Hotmail or Outlook email, you can use the below SMTP options.

hotmail smtp options in wp mail smtp

  • SMTP Host: smtp.live.com
  • SMTP Port: 587
  • Encryption: Use TLS encryption
  • Authentication: Yes: Use SMTP authentication.

Then, enter your Live, Hotmail or Outlook username and password, and click Save Changes.

Step 4: Enable Less Secure Apps

In order to configure SMTP on your WordPress site, you may need to enable less secure apps on your email account. Let’s take a look at how to enable it on different email providers.

Enable Less Secure Apps in Gmail

To enable less secure apps on Gmail, log in to your Gmail account. Then, go to less secure apps by clicking this link. Next to Access for less secure apps select Turn on.

gmail less secure apps to enable smtp

Enable Less Secure Apps in Yahoo

To enable less secure apps on Yahoo, log in to your Yahoo account. Then, click here to go to account security settings. Now turn on “Allow apps that use less secure sign-in”. After turning it on, the button color will be turned to green.

yahoo-less-secure-sign-in

Enable Less Secure Apps in Live, Hotmail or Outlook

If you’re using Live, Hotmail or Outlook email, you actually don’t have to enable less secure apps on your account to configure SMTP on your site.

Step 5: Send a Test Email

After configuring your SMTP options and enabling less secure apps on your email account, you’ll now need to send a test email to ensure that your SMTP authentication is a success.

To send a test email from your WordPress site, scroll down the WP Mail SMTP settings page. You’ll now see the Send a Test Email section.

You can enter your email address in the To field and click Send Test to generate a test email.

send test email in wp mail smtp

If the test email is successfully being sent, you can see bool(true) in the success message.

Finally, there are a couple more things you’ll need to keep in mind when you’re configuring SMTP on your site to receive WPForms notifications to your email without any trouble.

  • Be sure to set the same From Email on both the WP Mail SMTP settings and WPForms notification settings.
  • If you’re using Yahoo email, likely you won’t receive the test emails and form notification emails instantly. It may take about 5 to 10 minutes for them to arrive in your inbox.
Note: Sometimes for security reasons Gmail may automatically block the sign-in used by SMTP, even with less secure apps enabled. When this happens, your recovery email address will be sent an email with a sign-in attempt warning (see below). To remove this block, you’ll need to click the Review Your Devices Now button and follow the instructions to let Google know this was a legitimate login attempt.

enable smtp with gmail

That’s it! You’ve successfully configured SMTP on your WordPress site. You’ll now start getting notifications from your WordPress forms.

There are lots of different ways to configure SMTP on your WordPress site to get the form notifications. You can take a look at a few more ways to configure SMTP on your site.

What are you waiting for? Get started with the most powerful WordPress forms plugin today.

If you like this article, then please follow us on Facebook and Twitter for more free WordPress tutorials.

Comments

  1. How about enabling multiple email addresses?

    I use this plugin too but I have a dozen email addresses I’d like to set up forms for.

    They’re all on the same mail server and domain but they’ll each have different mail inboxes and passwords.

    1. Hi Darren,

      When you say you’d like to set up forms for those other email addresses, do you mean you want email notifications to be sent to different email addresses depending on the form?

      We recommend just using one email for your site as the “From Email,” since this ensures the best deliverability, but you can set up notifications to go to other email addresses using the “Send To Email Address” field.

      If you want to be able to reply to the email notification and reach a different email address, you can enter that address in the “Reply-To” field.

      Hope that helps! Please do reach out to support if you have any questions about customizing your notifications. WPForms has a ton of features to set up custom email notifications, so there’s sure to be a way to set yours up to work for your needs 🙂

  2. I have a client who’s been using this plug-in with no problem since 2015 in conjunction with Office365. It quit working about 2 months ago.

    The current scenario (with plugin turned off) is that email is delivered to any non-domain email address, but not to company email.
    so me@gmail.com works fine but any@company-domain.com is not delivered.

    If I turn the plugin back on, no mail is delivered.
    I also tried the other go-to SMTP plugin with the same results.

    We’ve been waiting 3 weeks to hear back from Office365 support,
    so this is as close as I’ll get to a rant, but working with Microsoft is like trying to get an audience with the Wizard of Oz

    It’s very frustrating as the owner immediately to place blame on the webguy (that’s me)

    1. Hi Bryan,

      I apologize for the frustrations you’ve encountered with this!

      Email providers are increasingly cracking down on emails in an effort to block spam, and are constantly changing their methods in these efforts — and this unfortunately often impact WordPress emails. That being said, I’m not aware of any reason why any SMTP plugin would suddenly stop working, unless your hosting provider has made changes (this can certainly result in the plugin not being able to function properly).

      Would you be willing to contact us in support? From there, we can troubleshoot within your site and try to get this sorted. Thanks! 🙂

      1. I’m having the same issue as BRYAN THOMPSON (who commented above) where my client has stopped receiving emails to their Office 365 inbox (same domain email address). The emails are instead being dumped into his spam folder. Have there been any updates or solutions to this issue?

      2. Hi Ben,

        Email providers are constantly increasing their efforts to block spam, and cause emails to suddenly stop getting delivered even when they were working before — but an SMTP plugin should allow you to circumvent this.

        If you’d like to check out all of our SMTP recommendations, you can check out this article. If you give one of those SMTP options a shot and encounter any issues, could you please let us know in support?

        Thanks! 🙂

  3. Hello

    My wp smtp was working normally more now the message appears when doing test:

    Bool (false) SMTP Could not authenticate

    1. Hi Johnatan,

      We’d be happy to help! The best way for us to start troubleshooting an issue like this is to log into you site to do double check settings and run tests. When you get a chance, could you contact us in support?

      Thanks! 🙂

    1. Hi Christy,

      As this article mentions, this has unfortunately become a fairly common issue. The solution described here is a great option, and we also have quite a few other SMTP recommendations here if any of them feel like a better fit.

      If you give one of the SMTP options a shot, please let us know if you have questions along the way! 🙂

  4. I did all these steps but I’m still getting an error message. Is there anything else that can be blocking me from working?

    1. Hi Reyn,

      Sometimes SMTP plugins can run up against site-specific issues, such as server configurations – but we’d be happy to help you get that sorted! Could you please contact us in support with any details that might help us troubleshoot?

      Thanks! 🙂

    1. Hi Celia,

      Great question. For most people, doing this is completely fine and will never create an issue – Gmail is essentially warning you that you’re allowing a third-party (in this case, your SMTP plugin) to have access that they normally wouldn’t.

      However, this is not a requirement of all SMTP plugins so if you’re concerned there are absolutely other options you can consider. For Gmail, for example, you can use Gmail SMTP — this doesn’t require you to enable less secure apps, because it uses Google’s API to be more secure. There are also several other options described in this doc (the other more secure options are listed under ‘Plugins Requiring a Subscription’).

      Essentially, options like this will be more secure but also a bit more complex to set up. If you check out that doc, though, you’ll see tutorials for each of the SMTP plugins discussed!

      I hope this helps! If you’d like more details, please feel free to get in touch with us in support 🙂

  5. Hello

    I have a client who is using an AOL account which they wish me to set up to receive book-in requests using WPForms , i followed the steps but used the AOL configuration instructions-

    SMTP Outgoing Server Address: smtp.aol.com Set the port to 587
    SMTP Username: YourUsername@aol.com (or @love.com, @games.com, etc.)
    SMTP Password: password you use to login to Mail

    However i am still get an failed test email, any thoughts on what it could be ?

    1. Hi Nicola,

      Sorry for the trouble! It sounds like you have those settings set up properly, so there are a couple options for the next step:

      1) You could contact your host to make sure that they aren’t blocking SMTPs by default (for example, some hosts need to be asked to open the port you need)
      2) You could contact us in support and we can help you troubleshoot. We’d be happy to help 🙂

  6. I have set up 2 forms, one with WordPress Forms and one with CForm Builder. I cannot get the forms to send to my AOL email. I have had others try to send me a test form, I get nothing. They get the auto response for sending. I was able to get the test email when doing the form set up, but in trying to even send myself a test email, I get nothing. Can you please post the settings for using AOL? Maybe I don’t have something correct. I have the SMTP activated.

    1. Hi Dana,

      Great question. Here’s what I found on an AOL support page:

      Host: smtp.aol.com
      Port: 587
      Encryption: TLS

      Also be sure to set Authentication to ‘Yes: Use SMTP authentication’, then enter your AOL email’s username and password.

      If you give that a shot and still run into issues, could you please contact us in support? From there we can collect more details and help you troubleshoot.

      Thanks! 🙂

  7. after activating the plugin, i get the following error:

    I am wondering if this is related to my hostmonster account and port 465 being open.

    The SMTP debugging output is shown below:
    2017-06-29 23:16:59 Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array (
    )
    2017-06-29 23:21:14 Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable)
    2017-06-29 23:21:14 SMTP ERROR: Failed to connect to server: Network is unreachable (101)
    2017-06-29 23:21:14 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    1. Hi Michael,

      Some hosting providers do block certain ports by default, so it’s worth checking with them to be sure. When we see this error in the SMTP test, that’s often the cause.

      If you reach out to your host and they say the port you need is open, the next thing I’d check is whether Gmail itself is blocking the SMTP. To do this, double-check that less secure apps are enabled (under Step 4).

      If you’re still stuck after giving these a shot, please feel welcome to contact us in support (you can use the left button on that link if you have an account, and the right button if not).

      I hope this helps! 🙂

  8. Great article.
    I have followed the guidance in the article, test email sent successfully and received in the “to” email address successfully. But still, I don’t receive any notification from the wordpress. Is there anything I missed?

    Thanks.

    1. Hi Ade,

      Most often when we see the test email delivering successfully but form notifications still not coming through, it’s has to do with the notification settings. If you could open your form builder and go to Settings > Notifications, there are a couple of things to check:

      1) In the Send To Email Address box, please check that if you have more than one email address they are comma separated.
      For example: {admin_email}, test@test.com

      2) Then, please check that the From Email is the same as the email you set up the SMTP with. This is key, as the SMTP can only work by sending through that one email address.

      In case it helps, you can use the Reply-To box to hold any email address (such as the Smart Tag for the email entered in the form), but the From Email must always match the email address in the SMTP.

      I hope this helps! 🙂 If these don’t do the trick, could you please contact us in support?

    1. Thanks so much, Christina! Glad it helped you out 🙂

      We’re always publishing new tutorials like this, so feel free to follow us on Twitter or Facebook to get updates if you’d like.

    1. Hi Marvin,

      We’re not aware of any SMTP issues with Hostgator, but if you have any concerns I’d suggest reaching out to them directly for the most up to date information 🙂

      We can also take a look on our end — if you’d like us to do this, please do Step 5 above to send a test email and then share the debug log with us (this will appear on the page immediately after you send the test email). This log helps us get a pretty good idea of where the issue lies, and you can copy it either into a forum post (for Lite users) or a ticket (for Pro users).

      Thanks! 🙂

      1. The test email went succesfully and received by a yahoo email, this is when I used my SMTP hostgator.

        But when I used and field up a form and submit, it sent the email confirmation to the user(yahoo email), but went to the spam folder, and the email included this error and below it are the form data, and it went to the spam folder:

        This is the mail system at host gateway36.websitewelcome.com.

        I’m sorry to have to inform you that your message could not
        be delivered to one or more recipients. It’s attached below.

        For further assistance, please send mail to postmaster.

        If you do so, please include this problem report. You can
        delete your own text from the attached returned message.

        The mail system

  9. I have been using Postman SMTP in conjunction with WPForms. Everything was working fine. Within the last few days, Postman was removed from the repository for lack of support/updates/security flaws. I installed WP MAIL SMTP as a replacement. My notification emails are being sent fine but the Confirmation message is not being displayed on the screen. Are there any conflicts with these two plugins that I should know about? Thanks much.

    1. Hi Bill,

      Sorry for the trouble!

      We don’t have any conflicts with WP Mail SMTP, and this plugin actually recently became part of our plugin family. I haven’t seen the issue you’re describing before, but we can certainly help you to track down the cause — could you please get in touch with us so we can collect more details?

      Thanks! 🙂

      1. Thanks for your offer to take a look. Since I am using the “lite” version of WPForms, I can’t submit a ticket.

      2. Hi Bill,

        Sorry about that! We provide Lite support through our forum. If you could share any details, including the form URL and screenshots if possible, we’ll start investigating from there.

        Thanks 🙂

  10. Hi,
    I followed these steps for Gmail.
    But unfortunately the test email is bool false.

    The result was:

    bool(false)

    The full debugging output is shown below:

    object(PHPMailer)#11675 (76) {
    [“Version”]=>
    string(6) “5.2.22”
    [“Priority”]=>
    NULL
    [“CharSet”]=>
    string(5) “UTF-8”
    [“ContentType”]=>
    string(10) “text/plain”
    [“Encoding”]=>
    string(4) “7bit”
    [“ErrorInfo”]=>
    string(82) “SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    How can I fix this !?

    1. Hi Omid,

      I’m sorry to hear you encountered an issue with this. The best next steps are:

      – Run back through this tutorial and double-check everything (including the Gmail-specific issues). This can be frustrating, but there are so many pieces to this that it’s worth the effort.
      – Contact your hosting provider to find out if they have any settings that might block SMTPs by default (though fairly uncommon, some will do this so it’s good to check)

      If you give these a try, run another test email, and still see a bool(false) message, please let us know! You can submit a ticket to our paid license support or post in our WPForms Lite support forum.

      Thanks 🙂

  11. I did all the steps, and I also get the bool(true) result when email testing, and the email in my inbox. But I still don’t receive emails through the contact form on my website. How can I resolve my issue?
    Thanks!

    1. Hi Cristina,

      That’s great progress, and I believe I can help you with the last step. When we see what you’ve described (the SMTP working, but form emails still not delivering), the issue is usually with the notification settings. To check on this, you’ll need to open the form builder and go to Settings > Notifications. There, you’ll see a From Email field — this must be the same as the email you set up the SMTP with for the SMTP to be able to work.

      I hope that helps! If you have any questions, please let us know 🙂

  12. Hi, I am setting up a WordPress on localhost.
    I got all the things(configurations) done, but when sending test email, I encountered the following error:

    Fatal error: Maximum execution time of 30 seconds exceeded in D:\INT2026\htdocs\wp-includes\class-smtp.php on line 1151

    would you please help me out?

    1. I am using SMTP port 465 and it just report that:

      [authenticate] => SMTP Error: Could not authenticate.
      [connect_host] => SMTP Error: Could not connect to SMTP host.

      1. Hi Lin,

        I did some digging, and it looks like the timing error may be a result of your local server’s configuration. Here’s a GitHub discussion where users had similar issues — if you check that out, it looks like they solved this by changing the php.ini file.

        As far as the other errors, this can vary and may require you to do some other config changes to your local server. In case it helps, I’ve used both MAMP and Local by Flywheel for my local servers (default setup) with no changes needed to my config files. Also, be sure to check on the permissions discussed towards the end of this article — without those all sorted (as well as the blocking issue on Gmail), some email providers will block SMTPs from working.

        I apologize as we aren’t able to provide support for server issues, but I hope this helps you to troubleshoot!

  13. Thanks for your suggestion, but it still did not work.
    The following is the details of my local server.

    Actually I followed all the steps including the “Security setting” of Gmail account to allow “less secure sign-in”.

    Furthermore, I check the port 587 of smtp.gmail.com through “telnet” in command prompt and it seems to output something correct (220 smtp.gmail.com ESMTP q12sm1913197pgn.56 – gsmtp). And I am using TLS encryption method in my WordPress “WP mail SMTP settings”.

    BTW, I installed Apache 2.4 and PHP7.0.x separately, I did not use any package like XAMPP or MAMP.

    Hope you could do me a favor again. (thx)

    1. Hi Lin,

      I apologize, but we’re not able to provide support for local server configuration. You might consider using an alternative local host option such as one of the options I mentioned above, to see if their default config allows you to bypass the issue you’re seeing. Alternatively, you could try contact support for your current local server — since server configs can be very layered and complex, they’ll be the best resource to help you get up and running.

      I’m sorry we can’t help more with this issue, and hope you’re able to get this sorted.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.