Fixed ! Easy Setup Web mail in Laravel

Fixed ! Easy Setup Web mail in Laravel, there are a lot of errors while setup the web mail like SMTP, PORT, HOST, USERNAME, PASSWORD, ENCRIPTION, EMAIL FROM, MAIL FROM NAME etc.

While it’s confusing and comes errors to send email to the verified email after login user and all kind of sending the email.

It’s the simple process if you getting any kind of errors like mention below.

Connection to tcp://mail. Timed Out

Connection to tcp://mail. Timed Out errors comes while connection is not established well, you have missing something on setting, it’s trying to connect to the web mail but fail after some time.

don’t worry I’m mention below all solution.

see at the last for this solution, if you read all information then you will be export on it.

Expected response code 220 but got an empty response

This error comes while port is wrong, put the right and perfect port to connection.

It’s simple to find your port of web mail .

How to find web mail port in cPanel and mail setup

Go to your cPanel

go to your mail account create section

Click the Connect Device


Then you can see all details smtp of web mail setting for Laravel.

Note. follow the ssl/tls SMTP for more secure.

Just use the Outgoing SMTP Port 465 for the setting on your .env file for solve error Expected response code 220 but got an empty response.

Solved! Use SMTP Port 465 or according your showing in setting.

Cannot send message without a sender address

You are sending the mail in Laravel but Cannot send message without a sender address show the error, what is the reason behind it?

It’s solved, and just understand the reason you have forget the mail id from on .env file you have setup username password but you have not filled the MAIL_FROM_ADDRESS=null and you need to use it like.

MAIL_FROM_ADDRESS=info@youremail.com

Expected response code 354 but got an empty response

this errors comes while you are not setup correctly the MAIL_ENCRYPTION section or setting, you need to setup according to the SSL/TLS and Non SSL

If you are using Non SSL then you need to add the MAIL_ENCRYPTION=tls but it’s not recommended.

MAIL_ENCRYPTION=tls

Non SSL need to add 587 SMTP port.

and next problem is

Connection to tcp://mail. Timed Out web mail setting

this is the mainly wrong setup, but above mentions all solution is for every wrong setting, but some time it not declare the what is the exactly problem so I told you the right solution for it.

Main two factors remember for it.

first

What SMTP you are using for? SSL/TLS

if you are using the SSL/TLS SMTP protocol like 465 then you need to use MAIL_ENCRYPTION=ssl not the tls

MAIL_PORT=465
MAIL_ENCRYPTION=ssl

By default in Laravel has non ssl port 587 so you need to change 465 and ssl for the solution

Second

For Non SSL/TLS setup

MAIL_PORT=587
MAIL_ENCRYPTION=tls

Thanks.

Leave a Reply