I suggest go over https://laravel.com/docs/11.x/mail#main-content and make sure all is configured correctly.
And look at https://laracasts.com/discuss/channels/laravel/an-email-must-have-a-to-cc-or-bcc-header-error-in-laravel-10
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've setup an app and it's meant to be sending confirmation emails. The job was dispatched and completed 12 times before it just stopped, and started spitting out this error:
An email must have a "To", "Cc", or "Bcc" header.
After following the advice in the two existing threads on the topic, I've added an explicit to() on the envelope of the Mailable. However I still get the same error. I thought it might have been due to not using an Address() in the to field, but no dice.
What am I missing here?
The job's handle method is:
public function handle(): void
{
// send notification email
$notificationEmail = Mail::to(env('CAREERS_MAILING_LIST'))->send(new CareersNotification($this->officer));
// send confirmation email
$confirmationEmail = Mail::to($this->officer->getEmail())->send(new CareersConfirmation($this->officer));
Log::channel('mail')->info("Sending career emails.", [
'Confirmation' => is_null($confirmationEmail) ? "No Message Id" : $confirmationEmail->getMessageId(),
'Notification' => is_null($notificationEmail) ? "No Message Id" : $notificationEmail->getMessageId(),
]);
}
and my Mailables are:
// Notification Email
public function __construct(
public Officer $officer,
)
{
//
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
from: env('MAIL_FROM_ADDRESS'),
to: new Address(env('CAREERS_MAILING_LIST')),
subject: 'New Application Submitted By ' . $this->officer->getName(),
);
}
// confirmation email
public function __construct(
Officer $officer,
)
{
$this->officerName = $officer->getName();
$this->officerEmail = $officer->getEmail();
}
public function envelope(): Envelope
{
return new Envelope(
from: env('MAIL_FROM_ADDRESS'),
to: new Address($this->officerEmail),
subject: 'Thank you for your application! Here\'s your upload link.',
);
}
As an addition I've restarted the queue worker each time, and I've tried clearing the caches but I'm unsure when (or even if) I should be doing that. Any help would be greatly appreciated. Thank you all!
dont use env anywhere in your code other than config files as you will get null values once config is cached.
Have you tested that officer->getEmail() returns a valid value?
Please or to participate in this conversation.