Connecting to Mailgun

Introduction

This article shows you the steps required to integrate Gravity SMTP on your website with the Mailgun service by Sinch. Mailgun offers a free service when sending up to about 1,000 emails per month, which can make it a low commitment option for small websites with only modest outgoing email needs. They offer pay-as-you-go pricing or preset plans for sites handling a larger number of messages.

Integration Steps

To allow Gravity SMTP to send messages from your website via the SendGrid service, you will need to complete the following steps:

  1. Create a Sinch Mailgun account (as required for the plan you are using – see also flex plan).
  2. Add and verify a sending domain in Mailgun.
    Adding a sending domain to your Mailgun account is required in order to prove ownership of the email address and domain that outgoing messages will be representing. You must complete this step before configuring the Mailgun Integration within Gravity SMTP. Refer to this help guide for instructions on how to complete this step.
  3. Obtain your Mailgun API key.
    This will be required in settings to create the link between Mailgun and your website via Gravity SMTP. Refer to this help guide for instructions on how to find that API key in your Mailgun account.
  4. Complete the Gravity SMTP Settings screen.
    Go to Gravity SMTP → Settings → Integrations and click the settings cog on the Mailgun card. This will open a pop-up modal with all the fields required for SMTP to connect with Mailgun. See below for a description of these settings.
  5. Click Save Changes button.
    You should be returned to the Settings card page, and the Configured text should show at the bottom of the settings card for Mailgun. If your settings card still shows Not Configured, then there was an issue. Check your settings.
  1. Enable the integration using the on-off toggle (if you are ready to use it).
    Click the toggle on the settings card to turn on the Mailgun integration. This will show Mailgun as Connected. You can then test using the Gravity SMTP Tools, or using your website. Note that only one integration can be active at a time, so toggling one integration on will toggle any other active integration to off.

Mailgun Settings Reference

Configuration

TagDescription
Mailgun API KeyThe key provided by Mailgun that is used to authenticate with the Mailgun API.
See the “Steps” section for the process on obtaining this.
Please note that Gravity SMTP does not currently support domain-specific sending keys.

General Settings

TagDescription
RegionDetermines the service region from which messages will originate. If subject to EU regulations, consider the EU region.
From EmailThe from: email associated with outgoing messages.
Only applied when from: property is not explicitly set in the message being processed.
Force EmailIf enabled, the From Email will override any plugin settings for all outgoing email messages.
From NameThe from: name associated with outgoing messages.
Only applied when from: property is not explicitly set in the message being processed.
Force NameIf enabled, the From Name will override any plugin settings for all outgoing email messages.
Sending DomainThe domain from which messages will be sent. This will need to be a verified domain within Mailgun. See the “Steps” section for the process on verifying a domain.