Setting Up Reliable Email Notifications for WordPress (SMTP)
By default, WordPress tries to send emails (like password resets and contact form notifications) using the server's internal PHP mail() function. On most cloud servers and local environments, this fails completely or sends your emails straight to the Spam folder because the server isn't a trusted email sender.
The solution is to use SMTP (Simple Mail Transfer Protocol) to route your WordPress emails through a legitimate email provider like Gmail, Outlook, or SendGrid.
1. Install an SMTP Plugin
We need a plugin to hijack the default WordPress email function and force it to use SMTP. WP Mail SMTP is the industry standard.
- Log in to your WordPress Dashboard.
- Go to Plugins -> Add New.
- Search for "WP Mail SMTP".
- Click Install Now and Activate.
2. Choose Your Mailer
Upon activation, the Setup Wizard will launch. You can use it, or configure it manually.
- For Personal/Low Volume: Google / Gmail is excellent and free.
- For Business/High Volume: SendLayer, Brevo (formerly Sendinblue), or SendGrid are recommended.
- For Generic Hosts: Select "Other SMTP" if you want to use your web host's email (e.g.,
admin@yourdomain.com).
3. Configuration Example: Using Gmail (Free)
Using your personal Gmail account is the easiest way to get started without signing up for a new service.
Step A: Create an App Password
Google no longer allows you to just use your normal password for security reasons. You must generate a specific "App Password".
- Go to your Google Account settings (myaccount.google.com).
- Go to Security.
- Enable 2-Step Verification if it isn't already.
- Search for "App Passwords" in the search bar at the top.
- Create a new app password. Name it "WordPress".
- Copy the 16-character code it gives you.
Step B: Configure Plugin
- In WordPress, go to WP Mail SMTP -> Settings.
- From Email: Enter your Gmail address.
- From Name: Enter your site name.
- Mailer: Select Other SMTP.
- SMTP Host:
smtp.gmail.com - Encryption:
TLS - SMTP Port:
587 - Authentication: On.
- SMTP Username: Your full Gmail address.
- SMTP Password: Paste the 16-character App Password you generated (remove spaces).
- Click Save Settings.
4. Send a Test Email
Never assume it works. Always test.
- Go to the Email Test tab in the plugin settings.
- Enter your own email address.
- Click Send Email.
- Check your inbox. If you see the email (and it's not in Spam), your setup is complete.
5. Troubleshooting
- Connection Timed Out: Your server firewall might be blocking the SMTP port.
- Fix: Allow outgoing traffic on port 587.
- Authentication Failed: You likely copied the password wrong or didn't use an App Password.