Support the ongoing development of Laravel.io →
posted 7 years ago

Hi guys, i am using xampp (windows) with latest php version and laravel 5.4. here is my .env settings

MAIL_DRIVER = smtp
MAIL_HOST = smtp.gmail.com
MAIL_PORT = 587
MAIL_USERNAME = myemail@gmail.com
MAIL_PASSWORD = mypassword
MAIL_ENCRYPTION = tls

and the controller code

use Mail;

Mail::send('mail.login-verificatio', $data, function($message) use($email_to) {
    $message->to($email_to, '')->subject
        ('Login Security Number');
    $message->from('myemail@gmail.com','xxxxxxxxxxx');
 });

but i found the following error

ErrorException

stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

is anything need to configure in xampp or laravel ? thanks

Last updated 3 years ago.
0

Hi saiful! I think you need config in xampp. You can follow the steps:

  • Open php.ini file in C:\xampp\php\php.ini find extension=php_openssl.dll and **remove **the semicolon from the beginning of that line to make SSL working for gmail for localhost.
  • Continute find [mail function] and change:
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = myemail@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
  • Open sendmail.init in C:\xampp\sendmail\sendmail.ini, find and update:
[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=myemail@gmail.com
auth_password=password
force_sender=mmyemail@gmail.com

Now you done, remember restart xampp. Good luck!!!

Last updated 7 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

saiful saiful saiful.asia Joined 25 Aug 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.