close

[Solved] Expected response code 354 but got code “503”

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Expected response code 354 but got code “503” in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Expected response code 354 but got code “503” Error Occurs?

Today I get the following error Expected response code 354 but got code “503” in php.

How To Solve Expected response code 354 but got code “503” Error ?

  1. How To Solve Expected response code 354 but got code “503” Error ?

    To Solve Expected response code 354 but got code “503” Error I solved this by replacing Global “From” Address in mail.php file to the same input at .env for MAIL_USERNAME= .

  2. Expected response code 354 but got code “503”

    To Solve Expected response code 354 but got code “503” Error I solved this by replacing Global “From” Address in mail.php file to the same input at .env for MAIL_USERNAME= .

Solution 1


For me, the solution was this:

After correctly setting up your SMTP or mail driver of choice. Sending a mail with a “mail-from” different from your hostname e.g “[email protected]” and your hostname is yourhost.com The mail will always go through, however, sending a mail with a “mail-from” as such: “[email protected]” which is possibly different from your .env mail authentication i.e “MAIL_USERNAME” : This will throw an error if that mail account hasn’t been set up on your hosted server or c-panel.

My .env file had:

But my code had:

public function build()
{
    return
      $this
        ->from('[email protected]')
        ->view('emails.clientNotification');
}

This fixed it:

public function build()
{
    return
      $this
        ->from(env('MAIL_FROM_ADDRESS'))
        ->view('emails.clientNotification');
}

Solution 2

I solved this by replacing Global “From” Address in mail.php file to the same input at .env for MAIL_USERNAME= .

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment