Quick Start (5 minutes)
1. Create Mailgun Account
2. Add Your Sending Domain
Option A: Use Mailgun Sandbox Domain (Quick Test)
- Mailgun provides a sandbox domain automatically
- Format: sandboxXXXXXXXX.mailgun.org
- Limitation: Can only send to authorized recipients (you must add email addresses manually)
- Good for: Testing before setting up your own domain
Option B: Use Your Own Domain (Recommended)
- Click "Sending" → "Domains" → "Add New Domain"
- Enter: mg.everydaytech.au (recommended subdomain)
- Mailgun will provide DNS records to add:
- TXT record for domain verification
- MX records for receiving bounces
- CNAME records for tracking
- TXT records for SPF and DKIM
DNS Records Example:
Type: TXT
Name: mg.everydaytech.au
Value: v=spf1 include:mailgun.org ~all
Type: TXT
Name: k1._domainkey.mg.everydaytech.au
Value: [DKIM value from Mailgun]
Type: MX
Name: mg.everydaytech.au
Value: mxa.mailgun.org
Priority: 10
Type: MX
Name: mg.everydaytech.au
Value: mxb.mailgun.org
Priority: 10
3. Get SMTP Credentials
- Go to "Sending" → "Domain Settings" → Select your domain
- Click "SMTP credentials" or "SMTP" tab
- You'll see:
- SMTP hostname: smtp.mailgun.org
- Port: 587 (TLS)
- Username: Usually postmaster@YOUR_DOMAIN
- Password: Click "Reset password" to generate a new one
4. Update DigitalOcean App Configuration
Edit .do-app-spec.yaml:
- key: SMTP_USER
value: postmaster@mg.everydaytech.au
- key: SMTP_PASSWORD
type: SECRET
value: YOUR_MAILGUN_PASSWORD_HERE
5. Deploy
cd /home/cw/Documents/IBG_HUB/rmm-psa-meshcentral
doctl apps update 0ceb0932-3fa7-4a42-9a51-f0a124360a04 --spec .do-app-spec.yaml
Testing
If Using Sandbox Domain:
- In Mailgun dashboard, go to "Sending" → "Domain Settings"
- Add authorized recipients (your email addresses that can receive test emails)
- Create a MeshCentral account with one of those email addresses
If Using Your Own Domain:
- Just create an account with any email address
- Check inbox (and spam folder)
Mailgun Dashboard URLs
Troubleshooting
Emails Not Sending
- Check Mailgun logs: https://app.mailgun.com/app/logs
- Verify SMTP credentials are correct
- Ensure domain is verified (green checkmark)
- Check MeshCentral logs: doctl apps logs 0ceb0932-3fa7-4a42-9a51-f0a124360a04
"Sandbox" Limitation
- Sandbox domains can only send to authorized recipients
- Add recipients in Mailgun dashboard or use your own domain
SPF/DKIM Issues
- Wait 24-48 hours for DNS propagation
- Verify DNS records: dig TXT mg.everydaytech.au
- Check with Mailgun's DNS verification tool
Emails Going to Spam
- Make sure SPF and DKIM records are set up
- Use a custom domain instead of sandbox
- Set up DMARC policy (optional but recommended)
Cost
- Free tier: 5,000 emails/month for first 3 months
- After trial: 1,000 emails/month free forever
- Flex plan: $0.80 per 1,000 emails (if you exceed free tier)
Alternative: Use Sandbox for Testing
If you just want to test quickly without setting up DNS:
- Use the sandbox domain: sandboxXXXXXXXX.mailgun.org
- Add your email as authorized recipient
- Update config:
SMTP_USER: postmaster@sandboxXXXXXXXX.mailgun.org
SMTP_FROM: noreply@sandboxXXXXXXXX.mailgun.org
Current Configuration
Next Steps
- ✅ Sign up for Mailgun
- ✅ Add and verify your domain (or use sandbox)
- ✅ Get SMTP credentials
- ✅ Update .do-app-spec.yaml with credentials
- ✅ Deploy with doctl
- ✅ Test by creating a MeshCentral account