553 5.1.3 The recipient address is not a valid RFC-5321 address

Viewed 10593

When sending bulk emails I was receiving several error messages that said:

553 5.1.3 The recipient address <john@example.com > is not a valid RFC-5321 address.

The format of the email addresses looked completely valid so I couldn't figure out at first why these messages weren't being delivered.

3 Answers

Upon further inspection, I noticed that the recipient email addresses for each of the failed messages had a single space on the end. It's not as hard to see in the example I provided above, but the error report I was viewing had smaller font and would sometimes put a line break where the space was, so it wasn't as obvious. By the way, I was using the SendGrid API to send these emails, but I don't think that the issue would be unique to using SendGrid.

if you are using node.js API for sending emails to people, you just need to add .trimRight() to your recipients email address in your API, so in this way the white space will be removed and you can successfully send your email. :)

I was using Django Restful Api and my mistake was, when registering the users, I had interchanged the email field with the username field. So the Smtp server was using the username as the email address used to send the verification emails. I corrected that interchanged the fields correctly and it worked.

Related