Laravel 9 - Infomaniak : Expected response code "250" but got code "550", with message "550 5.7.1 Sender mismatch"

1.7k views Asked by At

I hope I'm not in the wrong place for my problem, but I haven't found a solution for a week. I designed a new web application under Laravel 9 (now using Symfony Mailer). The problem is sending emails from accounts provided by Infomaniak. Shipping with OVH accounts or through MailHog and Mailtrap services works.

Error log:

local.ERROR: Expected response code "250" but got code "550", with message 
"550 5.7.1 Sender mismatch". 

{"exception":"[object] (
Symfony\\Component\\Mailer\\Exception\\TransportException(code: 550): 
Expected response code \"250\" but got code \"550\", with message 
\"550 5.7.1 Sender mismatch\". 
at /home/USER/www/APP/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php:308
)}

Under Laravel 8 (SwiftMailer) and earlier, it works.

Am I alone? Can anyone help me, thanks.

1

There are 1 answers

1
Boss COTIGA On BEST ANSWER

Solution found with the help of a laracast.com user by replacing "from" to "replyTo"

In the App\Mail\ContactMail ($this->request->email from form in contact view through ContactRequest)

Old code

public function build()
{
    return $this->markdown('emails.resa')
        ->from($this->request->email)
        ->subject('Demande de réservation ' . config('app.name'));
}

Changed to

public function build()
{
    return $this->markdown('emails.resa')
        ->replyTo($this->request->email)
        ->subject('Demande de réservation ' . config('app.name'));
}