Getting Your MailGun API Keys and Secrets Setup

To use mailgun in your application you will need to create a mailgun account and get an API key. This API key is a way for mailgun to verify that the app trying to talk to mailgun servers is truly your application, and not an imposter. An API Key is your application's MailGun Drivers License. Getting the API is a kind of pain (but not as bad as going to the DMV). See the below post to get started:

Getting Started with MailGun

Go to and click the signup button in the top-right corner:


Fill in the signup form and click “Create Account”:


The next page may look a little confusing but just scroll down to the bottom and click “Continue to Your Control Panel”:


(you may need to verify your email, or verify your account with a phone text message code) But once you get into your MailGun account, you should see a page like the below:


Click “Domains” from the top navigation (to the left on the top navigation). You should see a page like the below (my domains are omitted with black lines):


Click “Add New Domain” on the top-ish left side (highlighted green).

Fill in the “Domain Name” input field with the following:

mail +

So if my website domain is, I will put:

You will still be able to send emails from your normal domain like: [email protected]


Once you click “Add Domain” you should land on this page.



At this point, you are almost done! You don’t have to do anything with this page now. You can get help from your developer. Next thing to do is to click the “Domains” tab again at the top of the page:


You will see your new domain in the list now:


Click on your domain to get to this page:


You want to get the Default Password, API Base URL, and API Key and send those to your developer.


You don’t want these getting loose on the internet or google. You can find them here: 


That is it! You’ve (almost) set up your mailgun account. You’ll need to also verify your domain name. But that is another story. Ask your developer.