How to Configure WP Mail SMTP Plugin to Send Emails

This KB explains how to configure SMTP service for transactional (outgoing) emails on a WordPress application.

The following tutorial shows how to set up SMTP service for transactional (outgoing) emails in a WordPress application. We'll also walk you through the simple procedure of using this plugin to set email headers (from name and sender email).

How to Install and Configure WP Mail SMTP Plugin to Send Emails

Step 1: Install and Activate WP Mail SMTP Plugin

The first step of the process is the installation of the WP Mail SMTP plugin. For this log into the WordPress admin area of your site using the admin credentials.

In the left of the admin panel, click on Plugins, and then on Add New.

Locate the SMTP plugin via the search bar (WP Mail SMTP by WPForms for the purpose of this KB). Next, click the Install Now button.

Once the installation finishes, click the Activate button.

Step 2: Configure Sender Name and Email Address

To start the configuration process, visit the Plugins section in the left admin menu and locate the SMTP plugin. Click Settings to start the configuration process.

You will see the following screen with three major options.

From Email

In this section, enter the email address you want to set as the From email. This is the email address that will be displayed on all outgoing emails. Depending on your needs and the intended audience, this email may be or

It is also recommended to check the Force From Email checkbox to override any other SMTP configurations.

From Name

In the From Name field, type the name you want to show on outgoing emails. Checking the Force From Name checkbox overrides previous website settings.

Step 3: Configure SMTP Service

Select any of the below two methods.

PHP Settings (Default)

If you have server-wide SMTP configured on the server where your application is hosted, simply choose PHP as a Mailer.

Other SMTP Settings (Optional)

If you haven't configured server-wide SMTP or want to utilise a different email provider for your application, you can choose any reputable service (e.g., MailGun, SendGrid) or Other SMTP.

You can find your API Key from your Mailgun’s Control Panel as stated in their support KB.

Copy the key and then return to the WP Mail SMTP settings and paste it under the Private API Key field and then enter your Domain Name. Once these settings are saved, you’ll be ready to try sending a test email.

We also recommend checking the optional Return Path checkbox, which sets the return path to match the From Email. With option enabled, you will receive an email if any mails bounce (usually due to problems with the recipient's email server).

Step 4: Verify SMTP Settings

Now that the SMTP settings have been added to the WP Mail SMTP plugin, you should send a test email to confirm that everything is working properly. To do this, select the Email Test option at the top of the plugin screen.

In the Send To field, enter a valid email address (that you can access), and click the Send Email button. If everything goes well, you will see a success message. Check the inbox to confirm that you have received the test email.

To minimize problems with outgoing emails, we strongly advise creating an SPF record for your desired email service provider to your Domain Registrar.

Log into your Domain Registrar. Go to Domain Management and create a new record with the following values:

  • Type: TXT

  • Host: Enter your server public IP address

  • TEXT Value: Add the SPF record as per your SMTP service provider’s recommendation.

  • TTL: Choose the lowest value

  • Click Save to apply the settings.

That’s it! We hope this article was helpful. If you need any help, then feel free to create a support ticket.

Last updated