Black Friday Sale is live: save up to 85% on Web & WordPress HostingView Deals
Step-by-Step TutorialWordPress & Web OptimizationBeginner

How to Configure SMTP in WordPress for Reliable Email Delivery

Why Default WordPress Email Fails

WordPress uses the internal function wp_mail() to dispatch user notifications, contact form submissions, password resets, and WooCommerce order confirmations. By default, wp_mail() hands messages off to the local server’s sendmail binary via the PHP mail() function.

Because mail() does not authenticate with a real mailbox:

  1. Messages lack authenticated cryptographic headers (DKIM).
  2. The envelope sender often mismatches the “From” address, failing SPF checks.
  3. Major providers (Gmail, Outlook, Yahoo) classify unauthenticated PHP mail as spam or discard it entirely.

Configuring Simple Mail Transfer Protocol (SMTP) forces WordPress to authenticate against an actual mail server using valid credentials over an encrypted TLS connection.


Prerequisites: Gathering Mailbox Credentials

Before configuring WordPress, ensure you have created a domain mailbox in your hosting panel (e.g., notifications@your-domain). All WordPress hosting plans include business mailboxes on your own domain for this. Retrieve the following connection details:

  • SMTP Host: Usually mail.yourdomain.com or your server’s hostname.
  • Encryption: SSL/TLS or STARTTLS.
  • SMTP Port: 465 (SSL) or 587 (TLS).
  • Authentication: Always required (Yes).
  • Username: Your complete email address (e.g., notifications@your-domain).
  • Password: The mailbox password created in your hosting panel.

[!CAUTION] Password Clarification: Your mailbox password is the specific password assigned to the email account in your control panel, not your WordPress admin password or client portal account password.


Method 1: Configuring SMTP via a Standard Plugin

The most straightforward and maintainable approach is using an established WordPress SMTP plugin (such as WP Mail SMTP, FluentSMTP, or Post SMTP):

Step 1: Install and Activate the SMTP Plugin

  1. Log in to your WordPress administrative dashboard (/wp-admin/).
  2. Navigate to Plugins → Add New Plugin.
  3. Search for your preferred SMTP plugin (e.g., FluentSMTP or WP Mail SMTP).
  4. Click Install Now, followed by Activate.

Step 2: Configure the Outbound Connection Settings

  1. Navigate to the plugin settings page (e.g., Settings → WP Mail SMTP or FluentSMTP → Settings).
  2. In the From Email field, enter your exact domain email address (e.g., notifications@your-domain).
  3. Check Force From Email to ensure all plugins and form builders use this verified address.
  4. Set the From Name to your website or business name.
  5. In the Mailer selection, choose Other SMTP.
  6. Fill in the connection parameters:
    • SMTP Host: mail.yourdomain.com
    • Encryption: SSL
    • SMTP Port: 465
    • Auto TLS: On
    • Authentication: On
    • SMTP Username: notifications@your-domain
    • SMTP Password: Enter your mailbox password.
  7. Click Save Settings.

Method 2: Safeguarding Passwords via wp-config.php

To prevent SMTP passwords from being stored in plaintext inside the WordPress database or visible to other WordPress administrators, define them directly in wp-config.php:

Open your wp-config.php file and insert the following constants above the /* That's all, stop editing! */ line:

// Secure SMTP configuration constants
define('WPMS_ON', true);
define('WPMS_SMTP_HOST', 'mail.yourdomain.com');
define('WPMS_SMTP_PORT', 465);
define('WPMS_SSL', 'ssl');
define('WPMS_SMTP_AUTH', true);
define('WPMS_SMTP_USER', 'notifications@your-domain');
define('WPMS_SMTP_PASS', 'YourStrongMailboxPasswordHere');

When constants are defined, supported plugins automatically lock the corresponding UI fields and prevent credentials from leaking through database exports.


Step 3: Sending a Test Email

Always verify outbound mail deliverability before considering the setup complete:

  1. Within your SMTP plugin settings, locate the Email Test or Tools tab.
  2. Enter a personal email address (such as a Gmail or Outlook account) in the Send To field.
  3. Click Send Test Email.
  4. Check the diagnostic output:
    • Success: A confirmation message indicates the SMTP handshake, TLS negotiation, authentication, and dispatch succeeded.
    • Error: Review the error log. Common issues include incorrect port numbers (using 587 with SSL instead of TLS) or incorrect username formatting (must be the full email address).

Step 4: Verifying DNS Authentication (SPF & DKIM)

Authenticated SMTP ensures WordPress connects securely to the mail server. To ensure receiving mail providers accept your emails:

  1. Confirm your domain’s DNS includes an active SPF record granting your server permission to send mail on your domain’s behalf.
  2. Verify that DKIM records are active in your DNS zone to cryptographically sign outgoing messages.
  3. For detailed record syntax and troubleshooting, review our Email Authentication Guide.

Frequently Asked Questions

Why does default WordPress email fail or land in spam folders?

By default, WordPress uses the PHP mail() function. Emails sent via PHP mail() lack proper SMTP authentication, often lack valid message headers, and frequently fail SPF and DKIM sender checks, causing receiving mail servers to reject them.

Which SMTP port and encryption standard should I select?

Port 465 with SSL/TLS encryption is recommended for secure outbound delivery. Alternatively, Port 587 with STARTTLS encryption is widely supported. Standard unencrypted Port 25 should never be used on modern hosting networks.

Do I need a paid third-party email service to send WordPress emails?

No. You can use any existing domain mailbox provided with your Web Hosting Wale account (e.g. info@your-domain). For websites sending tens of thousands of marketing broadcasts per month, a dedicated transactional relay service is recommended.

Need Technical Assistance?

Web Hosting Wale support is available 24/7. Tickets are typically answered within 10-15 minutes.

Open Support TicketView All Support Channels