Email SMTP

Configure your WordPress site to send emails through a proper SMTP server instead of PHP’s mail() function. This dramatically improves email deliverability, ensuring password resets, notifications, and form submissions actually reach their recipients.

Use Cases

  • Fix emails not arriving or landing in spam folders
  • Send WordPress emails through Gmail, SendGrid, Mailgun, or other providers
  • Ensure contact form submissions and order notifications are delivered
  • Set a consistent “From” name and email address for all outgoing mail

The Problem with Default WordPress Email

By default, WordPress uses PHP’s mail() function, which:

  • Often gets flagged as spam by email providers
  • May be completely disabled on some hosting
  • Doesn’t authenticate the sender properly
  • Provides no delivery confirmation or error handling

SMTP authentication solves these problems by sending emails through a legitimate mail server.

How It Works

  1. Configure your SMTP server credentials in the module settings
  2. Switchboard intercepts all WordPress emails
  3. Emails are sent through your SMTP provider instead of PHP mail()
  4. Your password is encrypted before being stored in the database

Settings

SettingTypeDefaultDescription
SMTP HostTextYour mail server address (e.g., smtp.gmail.com)
SMTP PortNumber587Usually 587 for TLS or 465 for SSL
EncryptionSelectTLSTLS (recommended), SSL, or None
Require AuthenticationToggleOnMost SMTP servers require this
SMTP UsernameTextUsually your email address
SMTP PasswordPasswordYour email password or app password
From EmailEmailAdmin emailThe sender email address
From NameTextSite nameThe sender display name

Common SMTP Settings

Gmail / Google Workspace

SettingValue
SMTP Hostsmtp.gmail.com
SMTP Port587
EncryptionTLS
Usernameyour@gmail.com
PasswordApp Password (see below)

Gmail requires an “App Password” instead of your regular password. Generate one at Google Account Security. You’ll need 2-factor authentication enabled.

SendGrid

SettingValue
SMTP Hostsmtp.sendgrid.net
SMTP Port587
EncryptionTLS
Usernameapikey
PasswordYour SendGrid API Key

Mailgun

SettingValue
SMTP Hostsmtp.mailgun.org
SMTP Port587
EncryptionTLS
Usernamepostmaster@yourdomain.com
PasswordYour Mailgun SMTP password

Mailtrap (Testing)

SettingValue
SMTP Hostsmtp.mailtrap.io
SMTP Port587
EncryptionTLS
UsernameYour Mailtrap username
PasswordYour Mailtrap password

Mailtrap is excellent for testing email functionality during development without sending real emails.

Testing Your Configuration

After saving your SMTP settings, use the built-in test feature:

  1. Enter a recipient email address (defaults to your logged-in email)
  2. Click “Send Test”
  3. Check your inbox for the test email
  4. If it fails, the error message will help diagnose the issue

Common test failures:

ErrorSolution
Connection timed outCheck host and port, ensure server allows outbound connections
Authentication failedVerify username and password, check for app-specific passwords
Certificate errorTry switching encryption from TLS to SSL or vice versa

Password Security

Your SMTP password is encrypted before being saved to the WordPress database. The encryption uses:

  • AES-128-CBC encryption
  • WordPress authentication keys for the encryption key
  • Base64 encoding for storage

This means your password isn’t stored in plain text, providing an additional layer of security.

From Email Best Practices

The “From Email” should be:

  • An email address you actually own and control
  • On the same domain as your website when possible
  • Configured in your email provider (SPF, DKIM records help deliverability)

Example: If your site is mycompany.com, use hello@mycompany.com rather than a personal Gmail address.

Rate Limiting

The test email feature has built-in rate limiting to prevent abuse:

  • Maximum 3 test emails per 5 minutes per user
  • This prevents accidental spam if someone clicks the button repeatedly

FAQ

My emails still go to spam. What else can I do?

SMTP is just one piece. For best deliverability:

  1. Set up SPF and DKIM records in your domain’s DNS
  2. Use a dedicated email service like SendGrid or Mailgun
  3. Ensure your “From” email matches your domain
  4. Avoid spammy content in your emails
Does this affect WooCommerce emails?Yes! All WordPress emails go through this SMTP configuration, including WooCommerce order confirmations, shipping notifications, and customer emails.
What if I disable the module?WordPress will revert to using PHP’s default mail() function. Your stored SMTP settings are preserved if you re-enable the module later.
Should I disable SMTP authentication?Almost never. The “Require Authentication” toggle exists only for rare server configurations that don’t need authentication. 99% of users should leave this enabled.
PRO

Get access to all 147 modules with a single license

Upgrade to Pro