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.
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.