Level 6
You might need to enable/open the required ports on your server (e.g. 587).
This might help: https://support.rackspace.com/how-to/open-ports-in-the-linux-firewall-to-access-pop-and-imap-mail-servers/
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am using Digital Ocean
.env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=gmailpassword
MAIL_ENCRYPTION=tls
ran the following commands after this
php artisan config:cache
php artisan cache:clear
sudo service nginx restart
was able to make this work in the local environment. But in the production environment i am getting this error
Connection could not be established with host smtp.gmail.com [Connection timed out #110]
You might need to enable/open the required ports on your server (e.g. 587).
This might help: https://support.rackspace.com/how-to/open-ports-in-the-linux-firewall-to-access-pop-and-imap-mail-servers/
Please or to participate in this conversation.