mailtrap error { Expected response code 250 but got code "550", with message "550 5.7.1 Relaying denied " }

I deployed my app in heroku, it’s a simple laravel vue.js blog I’m still learning

The problem is in the contact page, when I send mail from the localhost everything work perfectly
but when I try to send the email from the website "http://scifiblog.herokuapp.com/" it give me this error

{ Expected response code 250 but got code "550", with message "550 5.7.1 Relaying denied "}

I don’t know where is the problem and i didn’t find a solution
Here is my .env :

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=***********
MAIL_PASSWORD=***********
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=test@test.com
MAIL_FROM_NAME="${APP_NAME}"

Can you help me please to fix this bug?

Thank you !

19 thoughts on “mailtrap error { Expected response code 250 but got code "550", with message "550 5.7.1 Relaying denied " }”

  1. I recommed check two things.

    1. Open the file mail.php on yourproject/config

    Add this if you don’t have it in the configuration:

    'stream' => [
            'ssl' => [
                'allow_self_signed' => true,
                'verify_peer' => false,
                'verify_peer_name' => false,
            ],
          ],
    
    1. Also check the file .env the email configuration as the same to config.php on config folder.
    Reply

Leave a Comment