What is SMTP?
SMTP (Simple Mail Transfer Protocol) is a protocol used for sending emails across the internet. Unlike PHP mail functions, SMTP ensures reliable email delivery by authenticating the sender and using specific mail servers to handle the message. By using SMTP, you can significantly improve email deliverability, reducing the chances of emails landing in spam folders.
Sending emails from WordPress is essential for tasks such as admin alerts, password resets, and contact form submissions. By default, WordPress uses the PHP mail function to send emails, but this method can often be unreliable and may cause emails to be marked as spam. To enhance email deliverability, you can configure WordPress to use SMTP instead.
Why Use SMTP Mail instead of PHP?
SMTP is a protocol specifically designed for sending emails. Unlike the PHP Mail function, SMTP is a dedicated protocol that ensures reliable email delivery. Using SMTP can significantly reduce the chances of your emails landing in the spam folder. This is because SMTP employs proper authentication, which increases the trustworthiness of your emails.
Setting Up WordPress to use SMTP
To configure WordPress to use SMTP mail, follow these steps:
- Step 1: Log in to your WordPress admin dashboard.
- Step 2: Navigate to Plugins
- Step 3: Click on Add New Plugin.
- Step 4: Search for WP Mail SMTP and install the plugin shown below.
- Step 5: Once the plugin has installed, open it and enter the following details:
- SMTP Host: This is mail.yourdomain.com (replace yourdomain.com with your actual domain).
- SMTP Port: 587
- Encryption: TLS
- Auto TLS: ON
- Authentication: ON
- SMTP Username: Your email address @yourdomain.com
- SMTP Password: The password for the email address
Step 6: Click Save Settings.
Step 7: WordPress will now use SMTP to send emails, improving email deliverability.
Note: If you're using an external email service, you'll need to obtain the SMTP server and credentials from your mail provider. Some providers may also require an API key or have other special requirements.