Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error code '354' on send email on Laravel

Hi I'm making a web application and need to send some e-mails. I'm using Laravel 5.6, and make the e-mail feature at localhost using Mailtrap to test it, worked fine. But when I put it on the server I got a weird error, like in the picture bellow.

I've configured the system to my host, Hostinger settings.

This is the config code in the .env file

MAIL_DRIVER=smtp
MAIL_HOST=mx1.hostinger.com.br
MAIL_PORT=587
MAIL_USERNAME=E_MAIL_HERE
MAIL_PASSWORD=PASSWORD_HERE
MAIL_ENCRYPTION=null

enter image description here

like image 652
Nathan Avatar asked Oct 24 '18 01:10

Nathan


2 Answers

I have faced the same issue.

Basically, I changed config/mail.php variable MAIL_FROM_ADDRESS to my actual email and it worked.

enter image description here

like image 184
Rytis Dereskevicius Avatar answered Nov 10 '22 10:11

Rytis Dereskevicius


Code 354 is actually what Laravel expects, is not an error code. This is the SMTP server telling Laravel to proceed and send the body of the email. Note that this is what is expected, and not what you received.

Code 554 from a mail server indicates: "Transaction Failed", and you'll note that this is what you actually got.

The reason this is failing is indicated further in the message: Error: no valid recipients.

Without further data I can't tell why the recipient isn't set properly on your production server.

A more complete list of codes can be found here: https://www.greenend.org.uk/rjk/tech/smtpreplies.html

like image 5
haz Avatar answered Nov 10 '22 11:11

haz