How to Configure Mailgun SMTP

In this KB, you will learn about the procedure of integrating the Mailgun SMTP Add-on on your Cloudways server using the Cloudways Platform.

Emmad avatar
Written by Emmad
Updated over a week ago

Table of Contents

Mailgun is a third-party email service that is used to send outgoing emails through SMTP on the server. Those outgoing emails are maybe part of the email marketing campaigns or transactional emails such as password reset emails, order confirmation emails, user registration emails, etc. These external SMTP services like Mailgun, Elastic Email, SendGrid, Gmail maximize the deliverability of emails and are considered more reliable than the emails dispatching from your cloud server.

In this article, you will learn about the procedure of integrating the Mailgun SMTP Add-on on your Cloudways server effortlessly using the Cloudways Platform, so follow the steps written below for quick and easy integration.

What is Mailgun?

Mailgun is an email automation service provided by Rackspace. Mailgun offers a complete cloud-based SMTP and API service developed for developers but non-developers can also easily integrate their email service for sending, receiving, and tracking email through your websites and applications.

Mailgun allows you to send up to 5,000 emails for free in their trial plan for the first month. If you exceed the limit of the trial plan in a month, then the cost is $1/1,000 emails. Once done with the trial, you can upgrade to a paid plan. Read more about the Mailgun plans.

Benefits of Mailgun

We have listed the few benefits of using Mailgun below:

  • Mailgun is capable of integrating with local postfix service, sending emails via SMTP relay, and via API integrated programmatically with your existing cloud applications.

  • It increases the deliverability feature to lower bounce rates and spam complaints.

  • It offers detailed and searchable email logs that can also help diagnose email delivery failures.

  • It offers email forwarding/routing, storage, and parsing. No other transactional email service offers free email forwarding to other mailboxes which is quite unique and makes Mailgun stand out from its competitors.

  • Mailgun also offers email validation to ensure that your emails are getting delivered to real addresses.

How to Configure Mailgun SMTP

First of all, you need to get your Mailgun’s SMTP credentials that can be used while integrating Mailgun SMTP with your Cloudways’ server.


Please be advised that you need to have an account with Mailgun to integrate SMTP. If you do not have an account and you are choosing to use Mailgun as your email gateway provider, then you may create an account first before proceeding with this guide.

Step #1

Log in to your Mailgun account with your login credentials. First, enter your email address and hit Next.

Now, input your login password and click Next.

Now, select Sending from the left navigation bar.

Now, click the Domains option from this list.

Step #2

Here, you will see all of your custom domains and the sandbox domain provided by Mailgun. In this example, we are using a trial account of Mailgun that only allows the sandbox domain; therefore, we will use the same, but you can choose your desired domain which you want to use.

Now, select your desired domain to view the SMTP credentials.

Then, select SMTP from the given choices.

You will see your SMTP credentials on the same page, so make sure to take note of your username and default password.

Step #3

Log in to the Cloudways Platform using your email address and password. From the top menu bar, open Servers. Then, choose your target server.

Classic Interface

New Interface

Next, click on the SMTP option from the left menu bar.

Classic Interface

New Interface

Step #4

From the Select SMTP dropdown, choose an option called Your Own SMTP.

Classic Interface

New Interface

Now, you will see a few more fields down after choosing Your Own SMTP option.

  1. Select Mailgun as your email gateway provider from the drop-down list.

  2. Now, enter your username, which you copied earlier.

  3. Input your password, which you copied earlier.

Finally, hit Save.

Classic Interface

New Interface

How to Verify SMTP Configuration

Cloudways offers you the on-site functionality of testing your SMTP settings immediately after configuring the SMTP service on the server. You can verify if emails are properly dispatching from the server by sending a test email to yourself.

  1. First, click Send Test Email.

    Classic Interface

    New Interface

  2. Next, enter the Sender’s email address (From address).

  3. Enter your email address as the recipient (To address).

  4. Finally, click Send Test Email.


    The sender’s email address (From address) should be that verified email for which DNS records are properly pointed. Sender’s email with no DNS authentication will mostly land in spam.

    Classic Interface

    New Interface

    You will also get notified there once the test email is successfully sent.

Your Mailgun email service has been successfully configured on your server for outgoing transactional emails.

That’s it! We hope this tutorial was helpful. If you need any help, then feel free to search your query on Cloudways Support Center or contact us via chat (Need a Hand > Send us a Message). Alternatively, you can also create a support ticket.

Did this answer your question?