Sending WordPress email via SMTP

By default WordPress sends email with PHP mail. Such emails often land in spam or are rejected by Gmail. Sending through SMTP of a mailbox on your domain fixes it: the email is DKIM-signed and passes SPF.

You need a mail domain and a mailbox on the site domain, such as info@example.com: mail domain, mailbox.

1. Install the plugin

  1. WordPress admin: "Plugins" → "Add Plugin".
  2. Search for WP Mail SMTP.
  3. Click "Install Now", then "Activate".
Searching for WP Mail SMTP
Searching for WP Mail SMTP
The plugin is installed and active
The plugin is installed and active

2. Sender

  1. Open "WP Mail SMTP" → "Settings".
  2. "From Email": your mailbox address, such as info@example.com.
  3. Enable "Force From Email" so that all plugins send from this address.
  4. "From Name": the site name.
  5. "Mailer": "Other SMTP".
Sender address and name
Sender address and name

3. SMTP server

FieldValue
SMTP Hostmail.example.com
EncryptionSSL
SMTP Port465
AuthenticationON
SMTP Usernamethe full mailbox address
SMTP Passwordthe mailbox password
  1. Fill in the fields as in the table.
  2. Click "Save Settings".
SMTP settings
SMTP settings

4. Test

  1. "WP Mail SMTP" → "Tools" → "Email Test".
  2. "Send To": your address on another service, such as Gmail.
  3. Click "Send Email".
Test email
Test email
Email sent
Email sent

The email should arrive in the inbox. If it is in spam or missing, check SPF and DKIM: SPF, DKIM and DMARC.

Do not send site emails through a personal Gmail. The sender address must be on the site domain, otherwise mail services reject the emails.

Questions and answers
PHP mail emails often land in spam or are rejected by Gmail. Through SMTP of a mailbox on your domain they pass SPF and DKIM.
Server mail.your-domain, SSL encryption, port 465, login: the full mailbox address, password: the mailbox password.
Not recommended. The sender address must be on the site domain.