Websites and applications

Set up WordPress to use SMTP

Reviewed on 3 min read wordpress smtp

WordPress needs a mail transport to send forms, notifications and password resets. Setting up authenticated SMTP lets you use an identified sender account, although on its own it does not guarantee delivery to the inbox.

Install an integration

Easy WP SMTP is an option that supports custom SMTP. Install it from the official directory, check its requirements and use only one active integration for WordPress's transport.

In the settings or wizard, select Other SMTP for a conventional SMTP connection. The plugin documentation describes that mailer. Google or Microsoft may require another authentication method depending on the account.

Account on the same Hostsuar hosting

If the mailbox is created on the same server that runs WordPress, set:

Field Value
From Email Sender account, for example contacto@tudominio.com
From Name A recognisable name for your business
SMTP Host localhost
Encryption None, for this local connection
SMTP Port 25
Authentication Enabled
Username Full mailbox address
Password That mailbox's password

The account must exist in cPanel. A domain hosted here does not mean its email is hosted here too: check where the mailbox lives.

For a remote server, use its hostname, encryption, port and authentication. Do not reuse the unencrypted local connection over the internet or disable certificate validation to get past an error.

Sender and forms

Use the authenticated account or an authorised address as the sender. In a contact form, the visitor's address should normally go in Reply-To, not impersonate the sender. Check your domain's SPF, DKIM and DMARC policy.

Forcing a sender in the plugin can affect several forms or applications within WordPress. Check the result in each important flow before considering it correct.

Send a test and check the result

Save the settings and send a test to an account you control. Check the inbox, spam and delivery tracking. Then test a real form or password reset with a test account.

A success response means the next system accepted the message, not that the recipient read it or got it in their main inbox. If the plugin sends but the form does not, check the form and its recipients separately.

If it fails

Keep the error and the time without sharing passwords. Tell apart connection, authentication, rejected sender, quota or recipient rejection. If you use a Gmail API and a 401 appears, check its OAuth authorisation; it is not necessarily an SMTP error.

Do not switch to a personal account as a matter of routine or enable several sending plugins at once. Protect the logs, limit how long they are kept and avoid storing sensitive message content unless it is needed for diagnosis.

You may also find useful

Something wrong or out of date? Tell us and we will review it.