Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Receive WordPress Emails from Localhost

Last updated on by
Follow WPBeginner on YouTube
How to Receive WordPress Emails from Localhost

When using WordPress on localhost, you may come across situations where you would need to receive an email generated by WordPress or a plugin. By default, the mail functionality is not enabled on WAMP or MAMP on Mac server stacks. However, you can configure them to use Gmail SMTP server but this would require messing with the configuration files. In this article, we will show you how to receive or send WordPress emails from localhost.

Video Tutorial

If you don’t like the video or need more instructions, then continue reading.

First thing you need to do is install and activate WP Mail SMTP plugin on the WordPress installation on your local server. After activation, go to Settings » Email to configure the plugin.

The first option on this screen is the ‘From Email’, you need to enter your Gmail email address here. The next option is From Name which will be used as the name of the sender in outgoing messages. You can enter ‘WordPress’ here. This will make it easier for you to recognize an email. The third option on the screen is for choosing a mailer. The default php mail function will not work on most local server environments without configuring it. So you need to choose ‘Send all WordPress emails via SMTP’.

Setting up WordPress on Localhost to use Gmail SMTP server

Now you need to configure the plugin to use Gmail’s SMTP server to send mail. In the SMTP server field, enter and for the port field use 587. For the encryption option you need to choose TLS. Lastly, you need to click on Yes next to authentication, you would need to provide your complete Gmail address, e.g. and your Gmail password.

Adding Gmail SMTP Server details in WordPress on Localhost

That’s all. You can now click on Save Changes button to store your settings. Once your settings are saved, scroll down to the bottom of the page and try sending a test message. After sending yourself a test message, you can check your inbox to see if you have received the message and everything is working fine.

We hope this article helped you receive WordPress emails on localhost. For questions and feedback please leave a comment below or join us on Twitter.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. deepika says:

    It shows ‘Test message sent’ but I didn’t get any mail.

  2. CarolineElisa says:

    Thanks for this suggestion, but I can only get it to work if I ‘Enable access for less secure apps’ in Gmail, which Google does not recommend. Any other tips? :)

  3. Marty says:

    Tried this, no luck :( Any other suggestion? Thanks!

  4. Marty says:

    Hi! Thank you for a great article. I’m trying it all out, but still get an error when sending the test email: SMTP -> ERROR: Failed to connect to server: Operation timed out (60). So I did as suggested, added extension=php_openssl.dll. But nothing seems to work :( Anyone have another idea? Thanks!

  5. Jesse Brownstein says:

    After sending the test email, the browser loads infinitely without any indication of success/failure. How can I fix?

  6. jam says:

    Thanks very much for sharing your knowledge

  7. Joker says:

    This suggestion should work, But if you got error saying “Failed to connect to server: Unable to find the socket transport “ssl” ” ,
    Then Please do the following

    1. Edit your php.ini from your installed php folder

    2. Search for extension=php_openssl.dll

    3. The initial will look like this ;extension=php_openssl.dll
    Remove the ‘;’ and it will look like this extension=php_openssl.dll
    If you can’t find the extension=php_openssl.dll, add this line extension=php_openssl.dll.

    4.Then restart your Xampp or LAMP or APACHE server (depends upon which of these you’re using).

  8. Syed says:

    Nice article. Helped me. Works for me. Thanks.

  9. Komalchand says:

    I used your setting for localhost but it din’t works where it works for my test server. so ur suggestion will be helpful for me. Thanks

  10. Easy says:

    sory if my question sounds sily bt which inbox am I to check?. am on a local machine without an internet service. or do I need internet to receive the mail?

  11. Bhargav says:

    I didnt get email. Please help me.

  12. Cristian Nebunu says:

    This is actually really helpfull. I needed to test some custom features and now i know how.

  13. adolf witzeling says:

    Very helpful. Thanks for sharing.

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 comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.