Support the ongoing development of Laravel.io →
Configuration Mail Installation

I trying to use laravel 4.1 mail function with xampp in windows OS. I am using gmail smtp to send the mail. but my mail fails with the following 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.

This is my mail.php:

return array(

'driver' => 'smtp',

'host' => 'smtp.gmail.com',

'port' => 587,

'from' => array('address' => 'mymail@gmail.com', 'name' => 'Title'),

'encryption' => 'tls',

'username' => 'myemail@gmail.com',

'password' => 'password',

//'sendmail' => '/usr/sbin/sendmail -bs',

'sendmail' => '\"C:\xampp\sendmail\sendmail.exe\" -t',

'pretend' => false,

Controller code:

  public function sendEmail(){
	try {	
			$mail = Mail::send('emails.users.welcome', array('firstname'=>Input::get('firstname')), function($message){
				$message->to(Input::get('email'), Input::get('firstname').' '.Input::get('lastname'))->subject('Welcome to the Laravel 4 Auth App!');
			});
			return $mail;
			
		}
	catch (Exception $e) {
			Log::error("UserController -> sendEmail() -> " . $e->getMessage()) ;
			return "false";
	}
}
Last updated 3 years ago.
0

Same problem. I solved it turning off TLS in .env and mail.php files

config/mail.php

'encryption' => 'tls'

.env

MAIL_ENCRYPTION=
Last updated 8 years ago.
0

changing just on .env would do fine. no need to change both

0

Sign in to participate in this thread!

Eventy

Your banner here too?

winnyboy5 winnyboy5 Joined 14 Oct 2015

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.