Easy WP SMTP

Easy SMTP Plugin for WordPress

  • Home
  • Documentation
  • Contact

Setting Up the Mailgun Mailer

February 14, 2023 by Kyle Wymer

In this tutorial, we’ll cover how to use the Mailgun mailer with Easy WP SMTP.

  • 1. Signing Up for a Mailgun Account
    • 2. Verifying Your Domain
    • 3. Checking Your Mailgun Verification Status
    • 4. Configuring Easy WP SMTP Settings

      1. Signing Up for a Mailgun Account

      First, you’ll need a Mailgun account to start this setup process.

      Creating a Mailgun Account

      If you don’t have an account with Mailgun, go ahead and sign up for a Mailgun account on their website. 

      Mailgun signup page

      Note: Keep in mind that Mailgun accounts without a credit card can only send emails to 5 recipients. If you want to remove this limitation, you’ll need to add a credit card to your account. For more details, check out Mailgun’s sign-up page.

      Once you’ve finished filling out the short sign-up form, there are a couple more verification steps to complete. These verification steps help Mailgun ensure high email deliverability standards for all its users.

      First, you’ll receive an email to verify your Mailgun account. To begin the verification process, click the Verify your email address button.

      Verify your email address

      Then, you’ll be prompted to enter a mobile number to receive a text verification code.

      Account Verification

      After completing these steps, you’ll be logged into your Mailgun account automatically.

      Adding a Domain

      To continue the setup process, go to Sending » Domains from the left menu in your Mailgun dashboard.

      Sending domains

      Click the Add New Domain button on the Domains page. 

      Add new domain

      Then, enter a subdomain for your website’s domain name. A subdomain is like a separate section or directory of your website and replaces the “www” part of the address. For example, subdomain.example.com.

      In this case, the subdomain will only be used by Mailgun to send emails and won’t be visible on your website.

      You can name it anything you like, such as “mail.example.com” or “mg.example.com”. Naming it “mail” or “mg” can help identify what it’s used for.

      Domain name and region

      Next, in the Domain region section, you’ll have to select either US or EU. If your website is hosted in the European Union, select EU. If it’s hosted outside of the EU, go with the default US option.

      Domain region

      Next, open the Advanced settings (DKIM) by clicking on it. This gives you an extra layer of security against spam.

      Advanced Settings (DKIM)

      We suggest picking the 2048 option, which gives you a longer DKIM key. Finally, click the Add Domain button to move on to the next step.

      Add Domain Button

      Keep this page open, as we’ll return to it later in the next section.

      2. Verifying Your Domain

      To ensure the security of both site owners and their visitors, some SMTP services, including Mailgun, require verifying your domain by adding certain records to your site’s DNS. For more information on why verifying your domain is important, refer to Mailgun’s guide.

      To get started, open your site’s DNS settings. If you’re not sure how to find these, Mailgun provides helpful links on their setup page when you’re adding a domain.

      Note: If you’re not sure where to find your site’s DNS settings or feel unsure about making changes, please contact your site’s hosting provider before making adjustments.

      In the DNS settings, look for an option to add a new record.

      To verify your domain with Mailgun, you need to add two TXT records and then two MX records, all of which must be copied exactly from your Mailgun account.

      Add DNS record for sending

      There may also be a TTL (Time To Live) field for each record in the DNS settings. If possible, set the TTL to 1 day or 86400 seconds.

      Add MX Records

      Note that the records must be added to the subdomain you created, not the main domain.

      Now that you’ve added both TXT and MX records, your DNS settings are all set.

      3. Checking Your Mailgun Verification Status

      Mailgun will now check to make sure your domain’s DNS records are set up correctly. This might take up to 48 hours because changes to DNS records can take time to propagate.

      To see if the verification has finished, click the Verify DNS settings button.

      Verify DNS settings

      If Mailgun confirms your DNS changes, it will show that your domain name is active.

      Verified DNS Settings

      Don’t wait around for this to finish, you can move on to the next step while you wait. Just keep this tab open, you’ll need it soon.

      4. Configuring Easy WP SMTP Settings

      To prepare your WordPress site to start using Mailgun with Easy WP SMTP for sending emails, you’ll need to configure some plugin settings. To access the settings from the WordPress dashboard, go to Easy WP SMTP » Settings.

      easy-wp-smtp-settings

      In the following steps, we’ll go through each of these settings in detail.

      Mailer Settings

      Select the Mailgun option from the list of available mailers. Once you choose Mailgun, more settings related to this mailer will appear.

      Selecting Mailgun mailer in Easy WP SMTP settings

      Private API Key

      Mailgun will provide the Private API key, even if your domain is still waiting to be verified. You may have received this information automatically by email. If not, use this link to get your Private API key.

      Alternatively, you can always access the API keys page by clicking on your profile and selecting API keys.

      API keys menu

      This will take you to a page with your API keys, and you can click the eye icon under the Private API key to view the entire key.

      Private api key

      After copying the text for the full key, paste it into the Private API Key field in the Easy WP SMTP settings.

      mailgun-private-api-key

      Note: If you have an older Mailgun account, you may see a prefix key- before your key. Be sure to copy this prefix and add it to your Easy WP SMTP settings as well, as leaving this out will cause issues with verification.

      Domain Name

      For the Domain Name, enter the subdomain you created in Mailgun (e.g. mg.example.com).

      mailgun-domain-name

      Region

      Next, make sure to check the Region setting and set it to match what you set up in Mailgun (outside of the European Union, select the US option).

      General Settings

      From Email Address

      By default, the From Email Address field will be filled with your site’s admin email.

      You can use any valid domain-specific email address for the From Email Address (e.g. [email protected]).

      You also have the option to enable the Force From Email if you want the From Email Address to be the same site-wide.

      from-email-address

      From Name

      The From Name is the name that appears in the emails sent from your site, letting the recipient know who sent the email. By default, the From Name is set to your site’s name. However, you can change the name to whatever you’d like.

      Similarly, you can enable the Force From Name toggle to apply the settings site-wide.

      from-name

      When you’re done with the configuration, be sure to click the Save Settings button to save your settings.

      click-save-settings-button

      That’s it! You’ve now successfully set up the Mailgun mailer with Easy WP SMTP.

      Filed Under: Mailers

      Useful Links

      • Documentation

      Copyright © 2023 | Easy WP SMTP Plugin | Privacy Policy