Expected response code 250 but got code "550", with message "550 5.7.1 Relaying denied "
Asked Answered
T

2

15

I am getting this error Expected response code 250 but got code "550", with message "550 5.7.1 Relaying denied " when I try using mailgun and laravel 7 to send emails. But I do not know what to do

Transpacific answered 25/7, 2020 at 15:33 Comment(2)
please accept my answer if you find it correctNocturn
Kindly paster your code, we have a look you might be missing something. Also, Laravel changed from MAIL_DRIVER to MAIL_MAILERHalvorson
N
41

Make sure you have MAIL_MAILER=mailgun instead of MAIL_DRIVER=mailgun

It changed in Laravel 7+.

Use something like this:

[email protected]
MAIL_FROM_NAME=example
MAIL_MAILER=mailgun
MAILGUN_DOMAIN=mailgun-domain.example
MAILGUN_SECRET=example-key-here
MAILGUN_ENDPOINT=api.mailgun.net
MAIL_ENCRYPTION=tls
Nocturn answered 28/9, 2020 at 5:30 Comment(5)
Boom. Thank you!Strange
Hey @Abeer Sul! I am getting the same error on my webpage. But I am using October CMS and a plugin called "Magic Forms". Could you help me with it?Impermissible
Unfortunately @AbishekH I never used it beforeNocturn
@DarrenMurphy, you don't have to downvote it. There might be something else you need to change in your code. I faced many issues like everyone, this code fixed itNocturn
I had to exclude the MAILGUN_ENDPOINT I think it is only for EUDudeen
R
3

Check your config/mail.php file, to see whether MAIL_DRIVER or MAIL_MAILER is an env value. Then set MAIL_DRIVER or MAIL_MAILER in the .env file.

By default, emails are sent via SMTP. If you have set, for instance, MAILGUN_DOMAIN and MAILGUN_SECRET, expecting to us the API, this will not be the case, if the MAIL_DRIVE/MAIL_MAILER is not set up mailgun.

Rummy answered 18/5, 2021 at 14:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.