I'm looking for a way to disable sending of ALL emails from within Laravel. I'm working with a local deveopment copy of a website, and it's been sending off emails to actual users which is the last thing I want during testing.
What I've done:
I went into config/mail.php and added the following line:
'pretend' => true,
Additionally, there was some configuration in the .env file related to Mailgun (a domain and secret) which I've removed, so that there should be no possibility of connecting to Mailgun.
After this, the system continues to send out emails during testing. My understanding was that setting 'pretend' to true should be enough to route all email sending to the log file.
It's worth noting that the system is using BeautyMail, which to my understanding is just an email templating system. It does, however, look like the email that keeps going out is sent using the BeautyMail send() function:
$beautymail = app()->make(\Snowfire\Beautymail\Beautymail::class);
$beautymail->send('emails.templates.testemail', compact('url'), function ($message) use ($email) {
$message->from(Mailer::$sender)->to($email)->subject('Test email');
});
How can I disable this, and be sure that the system will not continue to fire off emails to actual users from my development environment?