Configuring the 'WP Mail SMTP' plugin

 

Overview

This article walks you through configuring the WP Mail SMTP plugin, which allows you to send email from any address you like (including non-DreamHost addresses like GMAIL). This is important as it allows you to send email through a mail server instead of the web server, preventing issues with Sender Domain Policy and Spoofing.

Gmail address

These instructions explain how to configure this plugin using a DreamHost email address created in the panel.

See this article instead if you want to use a Gmail address to send from your WordPress site.

Installing the WP Mail SMTP plugin

Before proceeding, make sure the plugin is installed and active.

DreamHost WordPress installs

The plugin is installed automatically when you install WordPress using the DreamHost WordPress installer in the panel. To activate it in your dashboard, navigate to the Plugins > Installed Plugins page and click the Activate link under WP Mail SMTP.

Other install types

If you used another method to install WordPress, you must manually install the plugin.

  1. Navigate to Plugins > Add New in the left pane in the WordPress dashboard.
  2. Search for wp-mail-smtp. It can also be found here.
  3. Click the Install button, then Activate. 

How to configure the plugin

There are two options to configure this plugin:

Option 1 — Using the Setup Wizard

The Setup Wizard is a quick way to configure your settings. If the Setup Wizard did not open during installation, you can open it on the plugin's settings page.

  1. Log in to your WordPress site.
  2. Navigate to the WP MAIL SMTP page.
  3. Click the Launch Setup Wizard button.
  4. Click the Let's Get Started button. A list of SMTP Mailers appears.
  5. Select Other SMTP and click Save and Continue.
  6. Enter the following SMTP settings.
    • SMTP Host - smtp.dreamhost.com
    • Encryption - TLS
    • SMTP Port - 587
    • Enable Authentication - toggle this option
    • SMTP Username - add your DreamHost email address
    • SMTP Password - enter the password for your DreamHost email address. You can also reset it if necessary.
    • From Name - enter a name you'd like to appear as being sent FROM
    • From Email - enter the email you wish to send FROM
  7. Click Save and Continue. Proceed through the next prompts depending on your preferences or if you're using the Pro version.
  8. Click Skip this Step or Save and Continue.
    The final page checks your configuration. When the check completes, a success message displays to confirm your email is configured.

After testing, you may see a DMARC warning. Your email will still function without it, but it's recommended you configure DMARC to further authenticate email.

Option 2 — Manually configure on the settings page

  1. Log in to your WordPress site.
  2. Navigate to the WP MAIL SMTP > General page.
  3. Fill in the following fields:
    • From Email - enter the email you wish to send FROM
    • Force From Email - check this box
    • From Name - enter a name you'd like to appear as being sent FROM
    • Force From Name - check this if you wish to force the FROM name
    • Return Path - check this box
  4. Choose Other SMTP under the Mailer section.
  5. Fill in the following under the Other SMTP section:
    • SMTP Host - smtp.dreamhost.com
    • Encryption - TLS
    • SMTP Port - 587
    • Toggle the Authentication button.
    • Username - enter your DreamHost email address
    • Password - enter your email address password
  6. Click the Save Settings button.

Adding extra security

This section is optional but highly recommended as it prevents your email credentials from displaying in the dashboard. If your admin dashboard is shared with others, this step prevents them from accessing any fields. See this page for further details.

If you proceed with this option, you do not need to enter any credentials into your WordPress dashboard, as they update automatically after adding them to your wp-config.php file.

Adding the constants to your wp-config.php file

  1. Log into your server via FTP or SSH.
  2. Use one of these articles to edit your wp-config.php file.
  3. Scroll down in this file to the following line:

    /* That's all, stop editing! Happy blogging. */

  4. Add the these lines just above this line.
    // turn constants on        
    define( 'WPMS_ON', true );
    
    // general configuration settings define( 'WPMS_MAIL_FROM', 'email@example.com' ); define( 'WPMS_MAIL_FROM_FORCE', true ); // True turns it on, false turns it off. define( 'WPMS_MAIL_FROM_NAME', 'Example Name' ); define( 'WPMS_MAIL_FROM_NAME_FORCE', true ); // True turns it on, false turns it off. define( 'WPMS_SET_RETURN_PATH', true ); // Sets $phpmailer->Sender if true.
    // specific configuration settings define( 'WPMS_SMTP_HOST', 'smtp.dreamhost.com' ); define( 'WPMS_SMTP_PORT', 587 ); define( 'WPMS_SSL', 'tls' ); define( 'WPMS_SMTP_AUTH', true ); define( 'WPMS_SMTP_USER', 'email@example.com' ); define( 'WPMS_SMTP_PASS', '********' ); define( 'WPMS_SMTP_AUTOTLS', true ); define( 'WPMS_MAILER', 'smtp' );
    The only parts you need to change are WPMS_MAIL_FROM, WPMS_MAIL_FROM_NAME, WPMS_SMTP_USER and WPMS_SMTP_PASS.
  5. Save the file.
    wp mail smtp plugin

View the plugin page and you'll see your credentials are not accessible.

Testing the plugin

Navigate to the WP MAIL SMTP > Email Test page and click the Send Email button to test.

You should see it was sent successfully.

After testing, you may see a DMARC warning. Your email will still function without it, but it's recommended you configure DMARC to further authenticate it.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?