Use mail.default_force config

This commit is contained in:
conory 2023-12-08 22:31:22 +09:00
parent 9ca263ebf5
commit 64537818f6

View file

@ -581,6 +581,11 @@ class Mail
$id = $random . '@' . (preg_match('/^(.+)@([^@]+)$/', $sender_email, $matches) ? $matches[2] : 'swift.generated');
$this->message->getHeaders()->get('Message-ID')->setId($id);
if (config('mail.default_force') && config('mail.default_from'))
{
$this->setFrom(config('mail.default_from'), config('mail.default_name') ?: null);
}
try
{
$this->sent = $this->driver->send($this) ? true : false;