I have been getting an error while i try to send an email using laravel 5.5 with gmail.
MAIL_DRIVER=smtp
MAIL_HOST=gmail-smtp-msa.l.google.com
MAIL_PORT=587
MAIL_USERNAME=mygmailadress
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
I changed the mail host from smtp.google.com to that one becuase i could not reach smtp.google.com
Here is the error i get when i try to send mail
stream_socket_enable_crypto(): Peer certificate CN=`smtp.gmail.com' did not match expected CN=`gmail-smtp-msa.l.google.com'
And this is the error that i use when i use mail_host smtp.google.com
Connection could not be established with host smtp.google.com
[php_network_getaddresses: getaddrinfo failed: Name or service not known #0
Note that everything was working well with my testing server mailtrap. So how can i make this work for production?