Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errors sending emails via mailgun

Tags:

email

dns

mailgun

A few of the emails being sent from my account are getting rejected. These are the error messages:

  1. Server response: 550 550 Requested action not taken: mailbox unavailable invalid DNS MX or A/AAAA resource record
  2. From: Domain is invalid. Please provide a valid From: IB506 http://x.co/srbounce

Is this issue on my end or their (the receivers) end? How should I fix this problem?

like image 546
vgoklani Avatar asked Jun 06 '16 21:06

vgoklani


People also ask

How many emails can you send per day with Mailgun?

5,000 messages/month are included. There is a limit of 300 messages per day on the included sandbox domain. Data retention for Logs and the Events API is 1 day.

How do I send an email using Mailgun?

Send via API Run this: curl -s --user 'api:YOUR_API_KEY' \ https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \ -F from='Excited User <mailgun@YOUR_DOMAIN_NAME>' \ -F to=YOU@YOUR_DOMAIN_NAME \ -F [email protected] \ -F subject='Hello' \ -F text='Testing some Mailgun awesomeness!

How do I verify my DNS for Mailgun?

1) Login to the Mailgun control panel and select the Domains section. 2) Select any domain that is in the orange “unverified” state. 3) In the Domain Verification & DNS section, locate the records with the red warning indicator.


Video Answer


2 Answers

You need to add the following MX records to your DNS and associate them with the subdomain mg.yourdomain.com

mxa.mailgun.org  10
mxb.mailgun.org  10

Likely you are seeing those errors because certain email servers do an MX lookup on the domain of the sender of the email (in this case mg.yourdomain.com). If those MX records do not exist, the server will reject the mail.

like image 61
rmacqueen Avatar answered Nov 14 '22 03:11

rmacqueen


You likely set up an MX record for your domain but not the subdomain from which the email is being sent. You need to set up an MX record for the subdomain also.

like image 41
jastr Avatar answered Nov 14 '22 04:11

jastr