Laravel not sending email and not giving errors

Laravel not sending email and not giving errors

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Laravel Not Sending Emails and Not Giving Errors

Silent failures are arguably the most frustrating class of bugs in web development. You execute your code, expect a notification to arrive, stare at the inbox for twenty minutes, and then realize the email never left the server. Worse than the missing delivery is the complete absence of feedback: no exception stack trace, no warning message, and no log entry indicating exactly where the process halted.

This specific scenario—Laravel configured with a mail driver but failing silently—is almost exclusively caused by one configuration setting: pretend.

In your configuration snippet, you have set 'pretend' => false. While this setting is intended to disable the logging-only behavior for production environments, it does not automatically enable successful delivery if the underlying connection parameters are missing. When Laravel attempts to send an email using SMTP or the PHP mail function without valid credentials or a reachable host, and depending on the specific version of Laravel and the driver implementation, it may default to a "pretend" mode internally or simply swallow the exception if the connection object returns null without throwing.

However, looking closely at your config/mail.php array reveals the actual culprit: you are configuring an SMTP host (smtp.mailgun.org) with TLS encryption on port 587, but you have left both the username and password as null.

When Laravel tries to instantiate the mail transport, it attempts to connect to smtp.mailgun.org. If the credentials are missing, the connection fails. In many versions of PHP's underlying mailer or older Laravel iterations, a failed SMTP handshake that doesn't explicitly throw an exception results in the application continuing as if nothing happened. The email is never queued for delivery, but the code execution flow resumes immediately after the Mail::send() call without raising an error.

To resolve this "silent failure," you must ensure that the authentication details are populated before attempting to send the message. If you are using a service like Mailgun, Postmark, or Amazon SES, you cannot rely on null values for credentials. You need to inject your specific API keys, username, and password into the configuration file.

If you are in a development environment where you do not want to risk sending emails to external addresses due to potential spam filters or misconfiguration, there is a safer alternative to debugging live SMTP connections: enable the pretend mode intentionally. By setting 'pretend' => true, Laravel will skip the actual network request entirely. Instead, it will write the full email content, headers, and status code to your application logs (typically in storage/logs/laravel.log).

This approach forces visibility on the issue. If you enable pretend mode and still see no log entry for your specific email action, you know definitively that the Mail::send() call is not being reached at all, pointing to a logic error in your controller or service. If the log entry appears but the message content looks incomplete or malformed, you can inspect the headers to verify if the SMTP library is handling the TLS connection correctly before sending real credentials.

Once you have validated the configuration, switch 'pretend' back to false (or remove the line entirely for Laravel 5.2+, where it defaults appropriately) and ensure your .env file contains the correct MAIL_USERNAME, MAIL_PASSWORD, and MAIL_HOST. Restart your application server or clear the config cache if necessary:

php artisan config:clear
php artisan cache:clear

Finally, verify that your code is actually invoking the mailer. In your provided code snippet, the syntax appears correct for Laravel 4.x or early 5.x versions. However, in modern Laravel (5.5+), the Mail facade was deprecated in favor of the Mail facade's underlying implementation via dependency injection or the mail() helper, and queueing became the standard pattern. If you are running a newer version of Laravel, ensure you are using the correct syntax for your specific version to avoid silent fallbacks.

By explicitly setting credentials and toggling the pretend mode to inspect logs, you transform a black box into an observable system, allowing you to identify whether the issue lies in network connectivity, authentication, or application logic.

Our network