This guide will cover how to install and configure WP Mail SMTP to send emails from your WordPress site using Sendgrid
WP Mail SMTP is not the only plugin available to integrate WordPress with Sendgrid, nor is it officially endorsed by Pantheon as the preferred method.
This guide assumes a pre-existing configuration of:
- An configured WordPress site. See our Quick Start guide if you need to set up a new WordPress site on Pantheon.
- A familiarity with the WebOps workflow, as we will be moving code and content between environments.
- A SendGrid account and API key. Follow the steps in Create a SendGrid Account to create and authenticate an account.
- If your site has access to Multidev, we suggest creating a new Multidev environment to work in. If so, substitute the Multidev name for
devin the guide below, unless otherwise noted.
Each method requires first setting your working environment (Dev or a Multidev environment) to SFTP mode.
From the Site Dashboard, navigate to the Dev (or Multidev) environment, and click on the Site Admin button. Log in to your WordPress Admin Dashboard.
Select Plugins, then Add New
In the search box, type "wp mail smtp". Results will update automatically. Locate WP Mail SMTP by WPForms and click Install Now:
Once installed, the same button will change to say Activate. Click it again.
WP Mail SMTP is now installed! You can now continue to Configure WP Mail SMTP for SendGrid.
When using Terminus, we suggest defining the variables
$env in your terminal session to match your site name and the Dev (or Multidev) environment:
export site=yoursitename export env=dev #Or a multidev name
Confirm that the environment is in SFTP mode:
terminus connection:set $site.$env sftp [notice] The connection mode is already set to sftp.
Invoke WP-CLI over Terminus to install and activate WP Mail SMTP:
terminus wp $site.$env -- plugin install --activate wp-mail-smtp Warning: Permanently added '[appserver.sendgridsmtp.0e1f236a-....drush.in]:2222,[126.96.36.199]:2222' (RSA) to the list of known hosts. Installing WP Mail SMTP by WPForms (2.5.1) Warning: Failed to create directory '/.wp-cli/cache/': mkdir(): Read-only file system. Downloading installation package from https://downloads.wordpress.org/plugin/wp-mail-smtp.2.5.1.zip... Unpacking the package... Installing the plugin... Plugin installed successfully. Activating 'wp-mail-smtp'... Plugin 'wp-mail-smtp' activated. Success: Installed 1 of 1 plugins. [notice] Command: anita-wordpress.sendgridsmtp -- wp plugin install wp-mail-smtp [Exit: 0]
From the WordPress Admin Dashboard's Plugins Page, locate WP Mail SMTP and click on Settings.
Under the General tab, in the Mail section, provide values for "From Email" and "From Name". In the Mailer subsection, select SendGrid:
In the next section, paste in your API key, then select Save Settings.
To confirm your settings are correct, select the Email Test tab and send a test email to yourself. Be sure to check your spam folder for the test message.
Congratulations, you've configured WP Mail SMTP for SendGrid!