'Sendgrid 550 unauthenticated senders not allowed laravel swiftmailer

When I'm using SendGrid to send email in Laravel, it results in the following error:

"550 unauthenticated senders not allowed"

I couldn't find out why this happens. So far, I've configured sender authentication from SendGrid account and created an API key, which is used as a password and username as apikey.

I've also tried with the same set of credentials (username and password) from SendGrid, but this also didn't work.

My .env file sets these mail parameters:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD=API Key
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME="text.com"


Solution 1:[1]

"If you’re getting an “Unauthenticated Senders Not Allowed” error, the problem usually lies in authenticating with our SMTP server. This error gets triggered when there was an attempt to hand over an email message through smtp.sendgrid.net before authenticating the connection with your SendGrid username and password."

From the docu at https://sendgrid.com/docs/for-developers/sending-email/smtp-errors-and-troubleshooting/#550-unauthenticated-senders-not-allowed

So check this:

  • make sure that you’ve configured your setup to connect to smtp.sendgrid.net using authentication
  • make sure that the credentials you’re using are the same credentials you use to login to the SendGrid

Repeat the steps described at https://sendgrid.com/docs/for-developers/sending-email/authentication/#api-key-recommended and at https://sendgrid.com/docs/for-developers/sending-email/laravel/

Replace 'apikey' and 'API Key' in your .env file by the SendGrid username and SendGrid password that you set.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jasie