Overview
WordPress has several SMTP plugins you can use to force any email address you like. This is important for two major reasons:
- It allows you to send email directly through your mail server instead of the web server. This helps to prevent issues with Sender Domain Policy and Spoofing.
- It allows you to send emails 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:
Google email
If you want to use a Gmail address to send from your WordPress site, view the following article instead.
Two options to configure the plugin
There are two options to configure this plugin, which are described in the following sections:
- Option 1: Use the Setup Wizard to guide you through each step
- Option 2: Configure manually on the settings page
Adding extra security
The final section is highly recommended as it further secures your email credentials. This extra step requires you to edit the main configuration file in your WordPress installation manually.
This is more advanced but also more secure. If your admin dashboard is shared with other admins, this will prevent them from accessing any fields.
Installing the WP Mail SMTP plugin
If you installed WordPress using the DreamHost WordPress installer in the panel
The WP Mail SMTP plugin is installed automatically when you install WordPress using the DreamHost WordPress installer in the panel.
You must now activate it in your dashboard.
- Navigate to the Plugins > Installed Plugins page.
- Click the Activate link under WP Mail SMTP.
You are then taken to the Setup Wizard to complete the configuration.
If you have an older DreamHost WordPress install or third-party installation
If you installed WordPress using the DreamHost WordPress installer in the panel before June 2021, you must manually install the WP Mail SMTP plugin.
- Navigate to Plugins > Add New in the left pane in the WordPress dashboard.
- Search for wp-mail-smtp. It can also be found here.
- Click the Install button, then Activate.
-
After clicking Activate, the Installation Wizard opens. You can also navigate to the Plugins page in your WordPress dashboard and click the Settings link under the 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.
- Navigate to the WP MAIL SMTP page.
- Click the Launch Setup Wizard button.
- Click the Let's Get Started button.
- A list of SMTP Mailers appears.
- Select Other SMTP and click Save and Continue.
- The next page lists all of your configuration options in different sections.
- Enter the following SMTP settings.
- SMTP Host - Enter 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
- Click Save and Continue.
- The next page lists additional features you could enable with the Pro version.
- Click Skip this Step or Save and Continue.
- The next page allows you to add your email address to receive recommendations on optimizing your email delivery.
- Click Skip this Step or Save and Continue.
- The next page asks you to enter your license key if you purchased the Pro version.
- 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.
You may see a DMARC warning after testing. Your email will still function without it, but you should configure DMARC to further authenticate your email. View the following for instructions on how to configure this on your domain.
Option 2 — Manually configure on the settings page
- Navigate to the WP MAIL SMTP > General page.
- 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
- Choose Other SMTP under the Mailer section.
- Fill in the following under the Other SMTP section:
- SMTP Host - smtp.dreamhost.com
- Encryption - Use TLS encryption
- SMTP Port - 587
In this example, port 587 with TLS is used. If you would rather use port 465, use the SSL option instead.
- Toggle the Authentication button.
- Username - Enter your DreamHost email address
- Password - Enter your email address password
- Click the Save Settings button.
Your form will now send FROM the email you entered above.
Adding extra security
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.
If you choose this option, you do not need to enter any credentials into your WordPress dashboard. They will update automatically when you add them to your wp-config.php file.
Adding the constants to your wp-config.php file
- Log into your server via FTP or SSH.
- Use one of the following articles to edit your wp-config.php file.
- Scroll down in this file to the following line:
/* That's all, stop editing! Happy blogging. */
- Add the following 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' ); - Save the file.
If you view the plugin page now, you'll see your credentials are not accessible.
Testing the plugin
- Navigate to the WP MAIL SMTP > Email Test page.
- Click the Send Email button to test.
- You should see it was sent successfully.
You may see a DMARC warning after testing. Your email will still function without it, but you should configure DMARC to further authenticate your email. View the following for instructions on how to configure this on your domain.
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.