0

I added all env configs but am still gettings this error:

"Unable to send an email: Forbidden (code 401) Heroku Laravel Mailgun Error"

My Mailgun successfully works on localhost but when deployed on Heroku it stops working.

Configs in .env:

MAIL_MAILER=mailgun
MAILGUN_DOMAIN=sandboxa0575477a07c4d46bc474dfd7d104316.mailgun.org
MAILGUN_SECRET=6fb8c8fdbd262ef08ff062388c8cb9f4-02fa25a3-ff2ddce5

Configs for mail..

4
  • stackoverflow.com/questions/43415563/…
    – STA
    Commented Jun 21, 2022 at 6:05
  • Didn't help bro. I tried before asking.
    – php_dev
    Commented Jun 21, 2022 at 6:10
  • set MAIL_MAILER=mailgun to MAIL_MAILER=smtp and try again
    – STA
    Commented Jun 21, 2022 at 6:19
  • Expected response code "250/251/252" but got code "550", with message "550 5.7.1 Relaying denied".
    – php_dev
    Commented Jun 21, 2022 at 6:25

1 Answer 1

0

The solution is to add these lines of code inside your .env file:

MAIL_MAILER=mailgun

MAIL_MAILER=smtp

Not the answer you're looking for? Browse other questions tagged or ask your own question.