Error Sendmail using laravel (Xampp + php 7, windows) i'm doing sendmail using laravel , but error i'm try
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=******
MAIL_ENCRYPTION=tls
but eror
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Help me fix.
I had the same problem.
First, make sure on php.ini has curl.cainfo , openssl.cafile and openssl.capath point to the right cacert.pem file,.
If you don't have it. you can download it from https://curl.haxx.se/ca/cacert.pem and place it anywhere you want
Just make sure you put the exactly path on ini file. This should solve your problem.
if don't , Disable your antivirus and test it again. This is how I got my problem resolve.
@adamhut whats the correct form to point the cacert.pam file?
I put openssl.capath="C:\xampp\sendmail\cacert.pem" and openssl.capath=C:\xampp\sendmail\cacert.pem\
but both returns me this error: failed loading cafile stream: `C:\xampp\sendmail\cacert.pem'
@frcam openssl.capath="C:\xampp\sendmail\cacert.pem" looks good to me . I have similar setting. I place the .pem file under "C:\xampp\cacert.pem". Just make sure you have the pem file on the folder. It should be able to load it.
@adamhut unfortunately, dosen't works for me..
When I put port: 587 and tls, returns me the same error:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed Help me fix.
And when I changed to port 465 and ssl returns me:
Connection could not be established with host smtp.gmail.com [ #0]
I have been loosing a lot of days with this! This error its driving me crazy!
Do you have another idea of what I can do? thanks!
@frcam Did you shut down your antivirus when you run the test?
I had exactly the problem like you have. it took me a long time to figure it out.
I will try my best to recall how I solve the issues.
On php.ini file the configuration for openssl.cafile , openssl.capath and curl.cainfo point to the right location when .pem file locate
disable the antivirus.
this may help => change the ['verify_peer' => false, 'verify_peer_name' => false] on mailer setting
Use send the mail using oAuth by using phpMailer through google API. for this I still do setting on point 3.
I hope this give you some help to solve the problem you have.
I write about this I think in 5 posts you just need to go in config/mail.php and where write
'username' => env( 'yourusername'), 'password' => env('yourpassword'),
change to this
'username' => 'yourusername', 'password' => 'yourpassword',
just please write here if this help
@adamhut Thank you so much! I solved the problem disabling the antivirus, it was driving me crazy!
@bajro17 I have this configs, but only solved when disabling the antivirus!
@frcam I'm happy because you solve it :)
Thank every all . i am try turn off avast :D
Thank you very much . i'm also turn off Avast now its working.
Please sign in or create an account to participate in this conversation.