I'm trying to send a simple email from my laravel 8 app using Google SMTP server, but it doesn't work, I'm getting this error:
Swift_TransportException
Connection could not be established with host smtp.gmail.com :stream_socket_client(): SSL:
or
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
I found many SO post regarding this issue but none of them worked for me, here's a list of what I have tried:
- Enabling less secure apps in the google account
- using ports 465 and 587
- Using
smtp.googlemail.com
andsmtp.gmail.com
- Using
MAIL_ENCRYPTION=tls
andssl
- Changing
'stmp'
to'sendmail'
- Blocking switmailer's ssl constraint
Is there something else I can try?
Here's my mail configuration, although I've tried many versions of it:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=address@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"