Search code examples
laravellinode

Sending email using Laravel but couldn't using Linode Shared Hosting


I tried to send an email using Laravel, but I could not email using Linode Shared Hosting.

Connection could not be established with host "ssl://smtp.gmail.com:465": stream_socket_client(): Unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=ssl
[email protected]
MAIL_FROM_NAME="${APP_NAME}"

Solution

  • In order to combat spam, Linode blocks SMTP on new accounts by default. There is a procedure you can follow to set up your account properly and then request that SMTP be unblocked.

    See this support article for the steps you need to follow.