Configuring the 'WP Mail SMTP' plugin


WordPress has several SMTP plugins you can use to force any FROM address you like. This is important for two major reasons:

  • It allows you to send email directly through your mail server as opposed to the web server. This helps to prevent issues with Sender Domain Policy and Spoofing.
  • It allows you to send email FROM another email host. For example, you can use your GMAIL address as the FROM email instead of your DreamHost address

One popular plugin option is WP Mail SMTP. This article walks you through how to configure this plugin.

DreamHost email

This article explains how to configure this plugin using a DreamHost email address created in the panel using the following article:

View the following article if you need to reset the email password.

Google email

If you want to use a Gmail address to send from your WordPress site, view the following article instead.

Configuring the WP Mail SMTP plugin

  1. In the WordPress dashboard, click 'Plugins > Add New' in the left pane.
  2. Search for wp-mail-smtp. It can also be found here.
  3. Click the Install button, then Activate. 
  4. After it's installed and activated, navigate to the 'Plugins' page in your WordPress dashboard.
    01 WP Mail SMTP.png
  5. Click the Settings link under the plugin.
    02 WP Mail SMTP.png
  6. 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
    • Mailer - Choose 'Other SMTP'
    • Return Path - Check this box
  7. Scroll down to the Other SMTP section. Make sure to toggle the 'Authentication' button.
    • SMTP Host -
    • Encryption - Use TLS encryption
    • SMTP Port - 587

      In this example, port 587 with TLS is used. If you would rather use port 465, make sure to use the SSL option instead.

    • Username - Enter your DreamHost email address
    • Password - Enter your email address password
  8. Click the Save Settings button.

Your form will now send FROM the email you entered above, but you should add the code below to further secure your credentials.

Adding code to hide your password

The instructions above add your password to the WordPress dashboard. To further secure your credentials, the plugin recommends you add code to your wp-config.php file instead. View the following page for further details.

Adding the constants to your wp-config.php file

  1. Log into your server via FTP or SSH.
  2. Use one of the following 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 following lines just above this line.
    define( 'WPMS_ON', true );
    define( 'WPMS_SMTP_HOST', '' ); 
    define( 'WPMS_SMTP_PORT', 587 ); 
    define( 'WPMS_SSL', 'tls' ); 
    define( 'WPMS_SMTP_AUTH', true ); 
    define( 'WPMS_SMTP_USER', '' );
    define( 'WPMS_SMTP_PASS', '********' );
    define( 'WPMS_SMTP_AUTOTLS', true );
    define( 'WPMS_MAILER', 'smtp' );
  5. The only parts you need to change are WPMS_SMTP_USER and WPMS_SMTP_PASS.
  6. Save the file.
    wp mail smtp password
  7. If you view the plugin page now, you'll see your credentials are not accessible.

Testing the plugin

Scroll to the top and click the Email Test tab. Click the Send Email button to test. You should see it was sent successfully.

Alternative plugins

There are several other SMTP plugins you can use to send email. After logging into your WordPress site, select 'Plugins > Add New' in the left pane. You can then search for the term 'SMTP' to view other options.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?