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

Aliloulaye's avatar

LARAVEL 8 is not sending mails when using command lines

Hello Laracast. I have an issue with Laravel 8. Whenever I try to send an email using command lines, the email is not sent. But it works fine locally on my machine. It also works when I use the route file or a controller to send the mail. The only scenario where the emails are not going is when I am online AND using command line. And there is NO ERROR GENERATED.

Consequently, cron jobs too are not sending emails. I have done a lot of research about it but I found no solution. Can someone tell me if there is a solution ? Is the issue related to SwiftMailer? The customer support of my hosting provider has not been helpful. So I am posting it here.

0 likes
2 replies
lbecket's avatar

I'd suggest that you try to isolate the error by changing your mail driver. If you eliminate SwiftMailer from the equation and send to log, can you get that to work? This would at least narrow down the problem and would alert you to whether the issue is with your local configuration or with the SwiftMailer integration.

1 like
Aliloulaye's avatar

@lbecket Thanks for your reply. Actually I solved the issue by changing my email server. I am using gmail now and it is working fine.

Please or to participate in this conversation.