Nov 8, 2023
7
Level 1
How to integrate Zoho SMTP in Laravel hosted on GoDaddy?
I bought a domain on GoDaddy and connected it to the Zoho email service. I have a Laravel project hosted on GoDaddy. I'm having Zoho SMTP issues when sending emails on a hosted project.
Everything runs smoothly when I run it on localhost; I can send emails with Zoho SMTP, but it doesn't work when I run it on the hosting server.
The email I registered in .env is an email I created in Zoho.
.env
MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
I have also tried the env settings as below:
MAIL_MAILER=smtp
MAIL_HOST=smtppro.zoho.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=ssl
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
And this is the mail.php code, here I add;
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
mail.php
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'),
'auth_mode' => null,
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
],
....
....
....
],
Note: I'm using Laravel ui package in my laravel project.
Please or to participate in this conversation.