Mailgun Setup – CloudFlare Domain Setup

SEARCH OUR BLOG

CATEGORIES

Categories

FOLLOW US

TABLE OF CONTENTS



Step-by-step Mailgun Setup


1. Sign up for Mailgun.com


2. Check your email inbox to verify the email address


VewuZVN3oFOFIvBdf4XqMAOX4vtVGv jNg
GU6IL6Y3N81qm6KMH9aTz7l5FV5IEv7ySA


3. Login to Mailgun, Click on Sending > Add New Domain




4. If your domain is companyname.com, you can either set up the main domain or subdomain with Mailgun. 


A. Main domain:

    Subdomain:

  • To set up the subdomain with Mailgun, you can type ANYTHING_HERE.companyname.com
    • Examples:
      • mg.companyname.com
      • replies.companyname.com
      • support.companyname.com

B. Please set up the domain or subdomain under US, not EU. not EU. not EU. 

C. Click on Add domain


woVjMqNw3YY Zjs20LoBHUb4KrThVvj Rw


The next screen that you’re taken to will ask you to add DNS records to your domain. Leave this screen open for the next step.


Screen Shot 2022-09-11 at 6.39.22 PM.png


5. Now log in to your DNS records based on where you get the domain and add the 5 DNS records.

To add the 1st TXT record


To Add your first TXT record, Log in to the Cloudflare dashboard and select an account and domain.

Click on DNS > Records

7Br2BkIKLhDBiHeqj6uRhzUTM68HZihKIQ

Click on + Add Record

vr JbieNqi07EUV9m4GhTYCExqDcTOc zw



Y8NTiChTf60Ju




A. Type: Select TXT from the Type menu options.


B. Name: DO NOT INCLUDE THE ROOT DOMAIN


  • Depending on the subdomain you are trying to set up, if you are trying to set up
  • If you are setting up a main domain like companyname.com, the host name will be @


C. Content: Same for everyone

  • paste the following record v=spf1 include:mailgun.org ~all

D. Click on Save

QCbqi3BnzhNKNCspyADXNWBZfk3F55e2dg





To add the 2nd TXT record

Click on + Add Record again

pGwHEEJ73iotP2Px sz8EMcZlT852MZg1g




A. Type: Select TXT from the Type menu options.


B. Name: it’s a bit tricky but the key here is to copy everything from the beginning until the subdomain part, DO NOT INCLUDE THE ROOT DOMAIN

**Everyone’s 2nd TXT record host name and value is different


Examples: copy the highlighted part ONLY

Example 1 using subdomain:

Copy mx._domainkey.helpdesk as the host name

Example 2 using main domain:

Copy mailo._domainkey as the host name

JSERXQQhYNvzVp7YoXhIji yeomZNLXUKA



C. Content: Head back to Mailgun and Copy the 2nd TXT record here highlighted in the screenshot below

  • Content: paste the 2nd very long copied TXT record here

UvAhE3LGN5sYkTb4kyEsXNM0GE0Uc8Eq1Q

D. Click on Save



To add the 1st MX records

qHcrrZPnp3g0LC4c75qM1hg opwYUXgE0w

Click on + Add Record again



P9K8ytrObBrwMJdpaEBYJYuK3S7Z iq5yg


If you have a Gsuite account to capture incoming emails for the main domain. Make sure you are using a subdomain for Mailgun. Check out Can I Use the Same Domain Name for Mailgun and for Google Apps (Or Another Email Server)?

A. Type: Select MX from the Type menu options.



B. Name: Different for everyone


Depending on the subdomain you are trying to set up, if you are trying to set up

mg.companyname.com The host name will be mg

replies.companyname.com The host name will be replies

If you are setting up a main domain like companyname.com, the host name will be @



C. Mail Server: Same for everyone

    paste the following data mxa.mailgun.org 

D. Priority is 10 which is also same for everyone no matter what domain you are trying to set

E. Click on Save




To add the 2nd MX records

Click on + Add Record again

7FOCRV3g2jhAT9ogHOZI9nNtWZiNGsDqlQ

A. Type: Select MX from the Type menu options.



B. Name: Different for everyone


Depending on the subdomain you are trying to set up, if you are trying to set up

mg.companyname.com The host name will be mg

replies.companyname.com The host name will be replies

If you are setting up a main domain like companyname.com, the host name will be @



C. Mail Server: Same for everyone

    paste the following data mxb.mailgun.org 

D. Priority is 10 which is also same for everyone no matter what domain you are trying to set

E. Click on Save






To add the CNAME record

3LyKoigujZ vEjMFQDflCfmRRfAJra3rYA

In Cloudflare, Click on + Add Record again

6ADDI371NG 0XbruZ2zs5EF4QgaagbkXqQ

A. Type: Select CNAME from the Type menu options.

B. Name: Different for everyone

Head back to Mailgun to copy the host name, it’s a bit tricky but the key here is to copy everything from the beginning until the subdomain part, DO NOT copy the main domain

Depending on the subdomain you are trying to set up, if you are trying to set up

  • mg.companyname.com The host name will be email.mg
  • replies.companyname.com The host name will be email.replies

If you are setting up a main domain like companyname.com, the host name will be email



C. Target: Same for everyone

        paste the following data mailgun.org

D. Click on the orange cloud Proxied to make it DNS only

E. Click on Save


Now that you have added 5 records, Go back to Mailgun and click on Verify DNS Settings


Click the same button to Verify DNS Settings again if some records are still not showing the green checkmark


I7T5QQCSjAnBvT1zqQlVgXSuNdgfuNiM3w



Once you add all the DNS records and verify, you can grab the Mailgun API Key – Where to Find in Mailgun & Put in HighLevel


Then we could send a test email to see if everything works! Click here to learn How to send a test email in the Conversation