WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
  • Deals
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» WordPress Plugins» How to Receive WordPress Emails from Localhost

How to Receive WordPress Emails from Localhost

Last updated on September 26th, 2014 by Editorial Staff
68 Shares
Share
Tweet
Share
Pin
Special WordPress Hosting offer for WPBeginner Readers
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

Subscribe to WPBeginner

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 smtp.gmail.com 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. yourusername@gmail.com 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.

68 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

36 Comments

Leave a Reply
  1. Prashant Sontale says:
    Nov 30, 2018 at 4:40 am

    I installed the plugin but I cant see the options such as those iin Mailer and also cant view the option of SMTP Host, Port, Authentication, Username, Password, etc. In mailer I haveoptions such as PHP, Google, Maligun, Sendgrid, Other SMTP. If I click on Google, they ask Client ID and Client Secret.

    What to do?

    Reply
  2. Carla says:
    Oct 12, 2018 at 12:31 pm

    That is to send… smtp… not to recieve the email on wordpress… POP3

    Reply
  3. swarna says:
    Jul 31, 2018 at 2:57 am

    my email is not working

    Reply
  4. Barka Piy Ndahi says:
    Oct 20, 2017 at 10:13 am

    Thanks for the tutorial.

    I have xampp and i tried above. It showed test message sent, though below i saw: 2017-10-20 13:06:18 SMTP Error: Could not connect to SMTP host.
    And i didnt see in my yahoo box.

    Please can you help me make this to work.

    Thank you.

    Reply
  5. Ashan Rupasinghe says:
    Jun 8, 2017 at 10:39 pm

    That’s Worked. Thanks.

    Reply
  6. sudhakar says:
    May 19, 2017 at 12:51 am

    Hi i did the same but i have did not get any email for contact form and product enquiry form think that in localhost mail system does not works or there is an idea means please help me

    Reply
  7. Vivekraj says:
    Mar 17, 2017 at 9:23 am

    Hi new user registration mail contact us mail are working but woocommerce order mail and all not sending to the customers. :(

    Reply
  8. mukesh says:
    Oct 7, 2016 at 7:42 am

    i m mukesh
    this is too good

    Reply
  9. surati says:
    Sep 23, 2016 at 8:58 am

    not work so work for me thnq…

    Reply
  10. Maksym says:
    Aug 19, 2016 at 3:11 am

    Works very good! Thank you :)

    Reply
  11. Steve says:
    Apr 30, 2016 at 12:01 pm

    You have to go into your Google account and turn on the feature “Sign In & Security > Connected Apps & Sites > Allow Less Secure Apps > ON”.

    Reply
    • Warren says:
      Sep 2, 2016 at 7:18 am

      Hi Steve

      What’s the navigation to get to the sign in and security > connected apps etc? Loads of tabs on the top once in settings, each with multitude of options.
      Thanks,

      Reply
      • Shashank Chattopadhyaya says:
        Nov 11, 2016 at 2:28 pm

        From your Google account:

        [Settings -> Accounts and Import -> Other Google Account settings -> Sign-in & security -> Connected apps & sites -> Allow less secure apps (turn ON)]

        Reply
    • Sharon says:
      Oct 7, 2017 at 4:49 am

      Same here. Otherwise gmail would authenticate because of the “Less secured application” :)

      Reply
  12. saurabh says:
    Apr 6, 2016 at 6:37 am

    awesome..blowsome.. worked!!
    make sure your gmail has access to third party apps to send email.nothing else is needed than this video. good work . loved it.

    Reply
  13. Pam Marshall says:
    Dec 5, 2015 at 4:19 pm

    Just what I needed to do my testing.

    Reply
  14. Roger Moore says:
    Aug 7, 2015 at 2:24 am

    I worked well after I enable access to less secure apps in my gmail account. Thanks

    Reply
  15. Chetan Buddh says:
    Jul 13, 2015 at 9:18 am

    array (size=18)
    ‘authenticate’ => string ‘SMTP Error: Could not authenticate.’ (length=35)
    ‘connect_host’ => string ‘SMTP Error: Could not connect to SMTP host.’ (length=43)
    ‘data_not_accepted’ => string ‘SMTP Error: data not accepted.’ (length=30)
    ’empty_message’ => string ‘Message body empty’ (length=18)
    ‘encoding’ => string ‘Unknown encoding: ‘ (length=18)
    ‘execute’ => string ‘Could not execute: ‘ (length=19)
    ‘file_access’ => string ‘Could not access file: ‘ (length=23)
    ‘file_open’ => string ‘File Error: Could not open file: ‘ (length=33)
    ‘from_failed’ => string ‘The following From address failed: ‘ (length=35)
    ‘instantiate’ => string ‘Could not instantiate mail function.’ (length=36)
    ‘invalid_address’ => string ‘Invalid address’ (length=15)
    ‘mailer_not_supported’ => string ‘ mailer is not supported.’ (length=25)
    ‘provide_address’ => string ‘You must provide at least one recipient email address.’ (length=54)
    ‘recipients_failed’ => string ‘SMTP Error: The following recipients failed: ‘ (length=45)
    ‘signing’ => string ‘Signing Error: ‘ (length=15)
    ‘smtp_connect_failed’ => string ‘SMTP connect() failed.’ (length=22)
    ‘smtp_error’ => string ‘SMTP server error: ‘ (length=19)
    ‘variable_set’ => string ‘Cannot set or reset variable: ‘ (length=30)

    this error come what can i do now?
    i can’t understand.
    plz help me guyz.

    Reply
    • Dan Canetti says:
      Aug 24, 2016 at 4:36 am

      Hi,

      Looks as though it’s failed to Authenticate. Try ensuring your Email and Password are entered correctly.

      Reply
  16. Gabriel Hernández says:
    Jun 10, 2015 at 5:28 pm

    Thanks! Works!=)

    I will save this great website.

    Reply
  17. Daniel says:
    Apr 7, 2015 at 9:45 am

    Works! Thamks for the manual. Google asks to ‘Enable access for less secure apps’ in Gmail, but for testing purposes I see no problem..

    Reply
  18. deepika says:
    Feb 3, 2015 at 8:41 am

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

    Reply
  19. CarolineElisa says:
    Nov 3, 2014 at 10:12 am

    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? :)

    Reply
  20. Marty says:
    Jul 23, 2014 at 5:18 pm

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

    Reply
  21. Marty says:
    Jul 23, 2014 at 5:17 pm

    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!

    Reply
  22. Jesse Brownstein says:
    Jun 12, 2014 at 10:00 pm

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

    Reply
  23. jam says:
    May 30, 2014 at 3:29 pm

    Thanks very much for sharing your knowledge

    Reply
  24. Joker says:
    Apr 26, 2014 at 7:44 pm

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

    Reply
  25. Syed says:
    Apr 3, 2014 at 4:32 am

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

    Reply
  26. Komalchand says:
    Feb 13, 2014 at 8:55 am

    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

    Reply
  27. Easy says:
    Jan 20, 2014 at 12:54 am

    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?

    Reply
    • WPBeginner Support says:
      Jan 20, 2014 at 11:19 am

      yes you will need an internet connection to receive email.

      Reply
  28. Bhargav says:
    Jan 5, 2014 at 10:05 am

    I didnt get email. Please help me.

    Reply
    • WPBeginner Support says:
      Jan 6, 2014 at 3:10 pm

      Make sure that you have correctly entered Gmail SMTP settings.

      Reply
  29. Cristian Nebunu says:
    Jan 3, 2014 at 12:51 pm

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

    Reply
  30. adolf witzeling says:
    Jan 2, 2014 at 12:15 am

    Very helpful. Thanks for sharing.

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WPForms Logo
WPForms
Drag & Drop WordPress Form Builder Plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 25 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2019 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2019)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2019)
    • SiteGround Reviews from 1032 Users & Our Experts (2019)
    • Bluehost Review from Real Users + Performance Stats (2019)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Start a Podcast with WordPress (Step by Step)
    • How to Choose the Best Domain Name (8 Tips and Tools)
    • How to Setup a Professional Email Address with Google Apps and Gmail
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2019 – Step by Step Guide
Deals & Coupons (view all)
Dreamhost
DreamHost Coupon
Get 40% OFF on DreamHost and get a Free Domain.
Elegant Themes
Elegant Themes Deal
Get all 87 amazingly beautiful WordPress themes by Elegant Themes for only $69. That is like $0.79 per theme!
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • Awesome Motive

Copyright © 2009 - 2019 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

WordPress hosting by HostGator | WordPress CDN by MaxCDN | WordPress Security by Sucuri.