golapraj
3 months ago
292
0
Servers

Mail sending using Gmail SMTP

Posted 3 months ago by golapraj

I am trying to send email using gmail smtp. everything working fine in localhost (win 10) but On server (Cpanel Based) show error:

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

my config

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME='[email protected]'
MAIL_PASSWORD='apppass'
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS='[email protected]'
MAIL_FROM_NAME="${APP_NAME}"

https://stackoverflow.com/questions/32515245/how-to-to-send-mail-using-gmail-in-laravel according to this suggestion when I use

MAIL_MAILER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME='[email protected]'
MAIL_PASSWORD='apppass'
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS='[email protected]'
MAIL_FROM_NAME="${APP_NAME}"

no error but mail not sending.

Please sign in or create an account to participate in this conversation.