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

mojemoron's avatar

Laravel sending mail not working on production server

Hello All, Whenever I try to send mail to a user my app sends mail to the log file even after changing driver to 'mail'. My server esp is: mail.pearlstack.com. Pls i need your help. Tnx PS: I don't kno if the driver is correct but host mail.pearlstack.com works on my mail client.

0 likes
6 replies
larafever's avatar

In the .env file

MAIL_DRIVER=smtp
MAIL_HOST=mail.pearlstack.com
MAIL_PORT=587
MAIL_USERNAME=your client username
MAIL_PASSWORD=youre client password
MAIL_ENCRYPTION=TLS

You check your mail client config from your cpanel or production server for more on the setup info

3 likes
mojemoron's avatar

@larafever thanks, it works perfectly. I edited the.env file. Driver is smtp and hosts :localhost

abdo_host's avatar

That is complete BS from your host. First thing, it's common for cloud systems to block OUTGOING SMTP, as it's a spam prevention measure, but your script is fine. Your host may be blocking everything but port 80, which means you can't connect to an SMTP host at all. You may be able to use localhost by not using SMTP at all, and use the builtin mailer(sendmail is common).

In the .env file

Change MAIL_DRIVER=smtp to MAIL_DRIVER=mail to use php's built in mailer. This may solve your problem, if not, then you should seek other hosting arrangements.

1 like

Please or to participate in this conversation.