Setting up SMTP (Simple Mail Transfer Protocol) in WordPress is an essential step to ensure that your website’s emails are delivered to users reliably. Whether you’re running a blog, an eCommerce site, or a membership platform, email notifications are critical for engaging with your users—whether for new user registrations, password resets, order confirmations, or newsletters.
WordPress sends emails by default using the PHP mail() function. However, this method is often unreliable, leading to email notifications ending up in spam folders or not being sent at all.
SMTP is a better and more reliable way to send emails through WordPress. In this guide, we’ll walk you through everything you need to know about setting up SMTP in WordPress.
Why Use SMTP Instead of PHP Mail?
Before we dive into the setup, let’s discuss why SMTP is the better choice over PHP mail.
- Email Delivery Reliability: SMTP helps prevent emails from being flagged as spam. Email servers recognize SMTP authentication as legitimate, whereas PHP mail is often considered less trustworthy.
- Authentication: SMTP requires proper authentication before sending an email, ensuring that your website isn’t being used to send spam or phishing emails.
- Avoiding Spam Folders: Many hosting providers limit the number of emails that can be sent using PHP mail and sometimes mark them as spam. SMTP helps avoid this problem.
- Better Debugging: SMTP logs all the email activities, which allows for easier troubleshooting when something goes wrong.
Step-by-Step Guide to Set Up SMTP in WordPress
Now that you know why SMTP is beneficial, let’s move forward with the setup process. Here’s a simple step-by-step guide to configuring SMTP in WordPress:
Step 1: Choose an SMTP Service Provider
First, you need an SMTP service provider that will handle sending emails. While some web hosting services offer SMTP, you may want to opt for a third-party service for better reliability. Here are some popular options:
- Google SMTP (Gmail): Free for personal use, though limited to 500 emails/day.
- Sendinblue: A popular choice for marketing emails and transactional emails, with a free tier offering 300 emails/day.
- Mailgun: Free for the first 5,000 emails/month, great for developers and startups.
- SendGrid: Another popular option offering 100 emails/day for free.
- SMTP.com: Premium service with excellent deliverability and advanced features.
Pick an SMTP service provider based on your specific needs, such as email volume, pricing, and features.
Step 2: Install an SMTP Plugin for WordPress
To make SMTP work with WordPress, you need a plugin that allows integration with your chosen SMTP service provider. There are several good plugins to choose from, including:
- WP Mail SMTP by WPForms: One of the most popular plugins, with over 3 million active installations. It supports multiple SMTP providers and is beginner-friendly.
- Post SMTP: A free, open-source SMTP plugin with great debugging tools.
- Easy WP SMTP: A simple, lightweight plugin for sending emails through an SMTP server.
For this tutorial, we’ll use WP Mail SMTP by WPForms, but the process is similar for other plugins as well.
Installation Steps:
- Go to your WordPress Dashboard.
- Navigate to Plugins > Add New.
- In the search bar, type “WP Mail SMTP” and click Install Now next to the WP Mail SMTP by WPForms plugin.
- After the installation is complete, click Activate.
Step 3: Configure the SMTP Plugin
Once the plugin is activated, it’s time to configure it with your SMTP settings.
Configuration Steps:
- Navigate to WP Mail SMTP > Settings in the WordPress dashboard.
- You’ll see several fields that need to be filled in, such as From Email, From Name, and Mailer.
- From Email: This is the email address that will appear as the sender of the emails sent by your WordPress site. Use a valid and authenticated email address associated with your domain to avoid deliverability issues.
- From Name: This is the name that will be shown as the sender. You can use your business name, website name, or your personal name depending on the context.
- Mailer: WP Mail SMTP offers several mailer options such as Gmail, Mailgun, Sendinblue, SMTP.com, and others. Choose the mailer that matches your SMTP provider.
- If you are using the Other SMTP option, fill in the following fields:
- SMTP Host: The address of your SMTP server (e.g., smtp.gmail.com for Gmail, smtp.sendinblue.com for Sendinblue).
- Encryption: Choose between SSL or TLS depending on your SMTP provider’s recommendations.
- SMTP Port: Typically 465 for SSL or 587 for TLS.
- Authentication: Enable authentication and provide your SMTP username (usually your email address) and password.
Step 4: Set Up SMTP for Gmail (Optional)
If you are using Gmail’s SMTP service, there are a few extra steps involved due to Google’s security policies.
Steps for Gmail SMTP:
- Navigate to Google Account Security settings and enable 2-Step Verification.
- Create an App Password in your Google account.
- Go to Security > App Passwords.
- Select the app as Mail and device as Other.
- Generate the password, which will be used for the SMTP configuration.
- In WP Mail SMTP, choose Gmail as your mailer.
- Paste the App Password into the required fields.
Step 5: Test Your SMTP Configuration
Once the SMTP settings are configured, it’s essential to test them to ensure everything is working correctly. WP Mail SMTP provides a built-in testing feature.
Testing Steps:
- Navigate to WP Mail SMTP > Settings.
- Click on the Email Test tab.
- Enter an email address to send the test email and click Send Email.
- If the test email is successfully delivered, you’ll see a confirmation message. If not, the plugin will provide an error message, which can help you troubleshoot the issue.
Step 6: Troubleshooting Common Issues
If your test email fails to deliver or you encounter issues while configuring SMTP, here are some common troubleshooting tips:
- Incorrect SMTP settings: Double-check your SMTP host, port, and encryption settings to ensure they match your SMTP provider’s guidelines.
- Firewall or Port Blocked: Some web hosts block the SMTP port. Contact your hosting provider to ensure that the required SMTP ports (587 or 465) are open.
- Authentication Error: Ensure that the email address and password you entered are correct. For Gmail, double-check your App Password settings.
- DNS Settings: Ensure that your domain’s DNS settings (such as SPF, DKIM, and DMARC records) are configured properly. These help verify the authenticity of the emails and improve deliverability.
Conclusion
Setting up SMTP in WordPress is an essential step to improve email deliverability and ensure that your site’s emails are reaching users’ inboxes reliably. By choosing a reliable SMTP service provider and configuring the right SMTP plugin, you can avoid common email issues like going to spam or not being delivered at all.
Whether you’re using Gmail, Sendinblue, or another SMTP service, the process is straightforward and only takes a few steps. After following this guide, you’ll be able to send WordPress emails confidently, knowing that they will reach their intended recipients.
By making this small but crucial configuration, you can enhance the professionalism and reliability of your WordPress site’s communications, creating a better experience for your users.