Updated: 22 October 2026 · Applies to: WordPress, sending mail via SMTP instead of PHP's mail() function

WordPress's built-in mail function is unreliable on many servers and is often flagged as spam. Sending through a real SMTP account, via a plugin, fixes both problems.

Install a current SMTP plugin

  1. Log in to wp-admin and go to Plugins > Add New.
  2. Search for "WP Mail SMTP" (by WPForms) or another actively maintained SMTP plugin, such as Easy WP SMTP.
  3. Click Install Now, then Activate.

Configure it

  1. Open the plugin's settings page (under Settings or its own menu item, depending on the plugin).
  2. Set the From Name and From Email to an address on your own domain.
  3. Choose SMTP as the sending method.
  4. Enter your SMTP host (for example mail.yourdomain.com), the port (587 for STARTTLS or 465 for SSL/TLS, check with your mail provider), and the correct encryption setting.
  5. Enable authentication, and enter a valid mailbox's username and password (an app-specific password, if your mail provider requires one).
  6. Save the settings.

Test it

Most SMTP plugins include a "Send a test email" option on their settings page. Use it, and confirm the test email actually arrives, including checking the spam folder, before relying on the configuration for real mail such as password resets or order notifications.

If the test fails, double-check the port and encryption combination first: a mismatch between the port and the encryption setting (for example, port 465 with STARTTLS instead of SSL/TLS) is the most common cause of a connection timing out rather than giving a clear error message.

Related services

Web hosting

shared hosting on Virtualmin with NVMe storage, free SSL and email.

Managed cPanel VPS

cPanel included; we handle updates, security and monitoring.

Hire an expert

engineers per 15 minutes, per hour or per month, with no contract.

Was this answer helpful?

Still stuck? Open a ticket