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

dilazni's avatar

laravel email not send on share hosting

I am try to send email using laravel in local machine work with my setting but not on godaddy share hosting my .env: MAIL_DRIVER= smtp MAIL_HOST= smtp.gmail.com MAIL_PORT= 587 MAIL_USERNAME= my email id MAIL_PASSWORD= my pswrd

mail.php is

0 likes
4 replies
Thyrosis's avatar

Two things that could be an issue here:

1. Wrong settings The Gmail SMTP servers and the connections are encrypted with SSL and are accessible through port 465. For TLS encryption, use port 587. So it depends on the type of encryption you've set in your .env file.

Check https://support.google.com/a/answer/176600?hl=en for the settings you need to use for your type of account.

2. Blocked port/mailservers I don't have any experience with GoDaddy at all, but maybe they've blocked outgoing SMTP connections to remote servers on their shared hosting platform. This is probably a less likely option, so I'd check #1 first.

dilazni's avatar

I am not able to send my code file mail .php , but above setting i had done, still mail was not sending

dilazni's avatar

share hosting uses mail.php not .env

1 like
nanpaul68's avatar

It could be a security issue from google allowing your app to send emails on your behalf. I had that issue once and had to use sendgrid

Please or to participate in this conversation.