Mailgun is a third-party service we use to send emails in bulk. For new onboarding agencies, you will be using LC email by default, which is living under a Mailgun account.
Visit Mailgun Signup (https://signup.mailgun.com/new...) and choose an appropriate plan.
Mailgun offers a variety of plans from a complimentary trial plan to different paid options.
Note: Plans with a dedicated IP address enhance email deliverability.
Log in to Mailgun and access your DNS manager. (i.e. Godaddy, Cloudflare, etc)
Select an existing subdomain or create a subdomain (e.g., mg.yourdomain.com) within Mailgun
Navigate to your Mailgun account, select Domains from the menu at the top. Then click Add New Domain.
Create a subdomain such as replies.yourdomain.com or mg.yourdomain.com and enter it in the Domain Name field.
You can leave all other settings as default.
Click Add Domain
Add necessary DNS records provided by Mailgun for validation and email operations.
Note: Only add domains you own. You will need to update your DNS records to verify that you are an authorized sender for this domain.
In Mailgun, you will see the DNS entries; 2 TXT records, 2 MX records, and 1 CNAME record. Go into your DNS manager where you will set up the DNS entries.
Navigate to the DNS record section for the domain you are using within Mailgun. You will now set up the 5 DNS records to ensure proper sending, replies and tracking.
Follow directions in Mailgun. Records are unique to your domain and Mailgun account.
TXT Records
These are to validate permission for Mailgun to send emails.
MX Records
These are so replies can be received and emails can be sent.
CNAME Records
This is for tracking clicks from your emails
The host will be a sub, subdomain. For example, emails.mg or emails.reply
After adding records, verify DNS settings within Mailgun.
Ensure all records have green check marks for successful verification.
NOTE: If the green check marks are not showing up, you'll want to ensure that the Host pieces for each record only have the sub-domain piece of the total record. For example, if the total record is mailo._domainkey.mg.mydomain.com, you would only put in mailo._domainkey.mg
Access API settings in Mailgun and copy your Private API key.
Navigate to API
Click on Settings on the left-hand side of the Mailgun dashboard.
Select API Keys from the menu below on the left-hand side.
On the following page, under the API Keys section, you'll see your Private API key.
Click on the eye icon to make the full API key visible. Copy this API key.
Submit a Support Ticket, pasting the API key to integrate Mailgun with your email platform.
NOTE: Ensure that you approve any verification emails that are sent to your inbox as the app attempts to integrate with your email platform. If you are receiving an error message, this is often the cause.
Transfer your domain to Cloudflare if you are migrating from another DNS provider and want to make use of page rules.
Complete the transfer before proceeding with Mailgun and Cloudflare setup.
Log in to Mailgun and set up mail routes for specific email addresses or domains.
Go to Routes section from the top menu. Now add as many routes as you want.
For example: If your domain is example.com and you want the mail sent to hello@example.com to be forwarded to doctor@who.com, then that would be a route.
Log into Mailgun and retrieve MX and TXT records for email forwarding and verification. You will see this information when viewing/creating your domain in Mailgun.
Access DNS Settings in Cloudflare.
Add CNAME, MX, and TXT records from Mailgun.
Add the CNAME record. Name = email, Value = mailgun.org, TTL = Automatic (these are examples, please use the actual items from your account)
IMPORTANT: Make sure the Cloudflare cloud is gray and not orange/active => You have to click on the cloud icon to change this to DNS only. If you are redirecting non-www to www or vice versa then proxy is implemented a specific way. We are not covering that in this article so view our articles on redirecting for that information.
Add the two MX records (these are examples, please use the actual items from your account)
Name = domain.com (no www), value = mxa.mailgun.org, Priority = 10
Name = domain.com (no www), value = mxb.mailgun.org Priority = 10
Add the two TXT records (these are examples, please use the actual items from your account)
Name= domain.com (no www), value = v=spf1…
Name = smtp._domainkey, value = k=rsa…
If you are not sure where you should add the DNS records
Lookup the domain that we are trying to set up in mxtoolbox (https://mxtoolbox.com/SuperToo...)
Only put the domain in the field, do not add http:// in front
Once you look up the domain, it should show what your DNS hosting provider is.
Check the bottom note it will say reported by e.g. wordpress.com
Connect your Mailgun account and use the API key for integration.
Send a test email to confirm successful setup.
Use a subdomain (e.g., mg.yourdomain.com) for Mailgun operations.
Configure MX records for optimal email delivery.
Choose between one subdomain for multiple client accounts or multiple subdomains for individual client domains.
Understand the pros and cons of each setup option before making a decision.