V5 Email not send

Hi
I just installed V5.3 in A2 Hosting. but email never works According to the manual I have configured .env like this:

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=email
MAIL_PASSWORD=***************
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=email
MAIL_FROM_NAME=Sunning inc

or

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=“mail”
MAIL_PASSWORD=“***************”
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=“mail”
MAIL_FROM_NAME=Sunning inc

Then run:php artisan optimize
Email never sends, logs has this error report
error

The same configuration works on V4, so i think it’s not a Gmail problem.

Hi,

Are there any details about the error if you expand the failure record?

Expand is empty.

Does .env need any additional configuration?

@david any ideas to debug?

I think I found the reason.

stream_socket_enable_crypto(): Peer certificate CN=*.a2hosting.com' did not match expected CN=smtp.gmail.com

A2 Hostimg must use A2 HOST Service

Sounds like an outgoing proxy of some kind.
This of course messes with the ssl/tls encryption between the server and the remote mail server.

You can come to Infiniroot with your setup :wink:
Or ask your provider if they can set up an ssl interception exception for smtp.gmail.com.

it looks like A2 hosting does something similar to godaddy in that they demand you use their mail servers.

I have solved it. Method: Use A2 hosting’s SMTP service. :smiling_face_with_three_hearts: