Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hilmi's avatar
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.

0 likes
7 replies
hilmi's avatar
Level 1

@jlrdw I use an email with a custom domain in Zoho, so I tried it with the code example that I included above, and the result was that it wouldn't work; I got an error: Connection could not be established with host "ssl://smtppro.zoho.com:465": stream_socket_client(): Unable to connect to ssl://smtppro.zoho.com:465 (Connection refused)

hilmi's avatar
Level 1

@jlrdw I've contacted them, but I haven't gotten an answer.

martinbean's avatar

@UUID If you have a question, post your own thread instead of bumping a year-old one.

Please or to participate in this conversation.