Failed to send email using smtp.zoho.com in laravel
I am trying to send mail using Laravel. Here's my mail config in .env.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.zoho.com
MAIL_PORT=465
MAIL_USERNAME=booking@bholebabatravels.com
MAIL_PASSWORD=xyzh
MAIL_ENCRYPTION=ssl
In my controller method:
Mail::send('Email.test', ['first_name' => $first_name, 'last_name' => $second_name, 'email' => $request->email, 'msg' => $msg, 'country' => $country, 'street' => $street_address], function ($message){
$message->to('malakar.rakesh1993@gmail.com')->subject('Booking Online!');
});
But I am getting this error:
Failed to connect to host smtp.zoho.com [Failed to try to connect because the related party did not respond properly after a while, or the connection failed because the connected host was unable to respond. # 10060]
I searched for the problem, but all I get is setting the correct configuration and that's it. The config looks ok. What could be wrong?
source to share
Laravel sets it out of the box hello@example.com
as the sender address. If you don't change this value, it is very likely that your email provider will not let your email go through.
You can change this toconfig/mail.php
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
source to share