This is a feature of Mandrill. You can either change this setting globally in your account, or you can pass in a custom header to enforce the setting per message.
Global account setting
The documentation for changing the setting globally is at https://mailchimp.com/developer/transactional/docs/outbound-email/#multiple-recipients.
From the docs:
To control whether recipients can see each others’ information in the To
header of your messages, navigate to the Sending Defaults
page and select or unselect Expose The List Of Recipients When Sending To Multiple Addresses
. You can override these global settings on a per-message basis with the preserve_recipients
parameter in your API calls, or with the X-MC-PreserveRecipients
SMTP header.
Per-message override
To override this global setting on a per-message basis, you can send your email with the custom X-MC-PreserveRecipients
header.
To do this, add a headers()
function to your PortalEmail
mailable:
use Illuminate\Mail\Mailables\Headers;
public function headers(): Headers
{
return new Headers(
text: [
'X-MC-PreserveRecipients' => 'true',
],
);
}
This will turn on the preserve_recipients
setting so that Mandrill will not modify the To
/Cc
headers.
Documentation for the customer header is at https://mailchimp.com/developer/transactional/docs/smtp-integration/#x-mc-preserverecipients.
From the docs:
If you send to more than one recipient at a time and want all recipients to see each other’s information, set this option to true
. If it’s set to false
, Mailchimp will rewrite the To
and Cc
headers to only show information about an individual recipient.
Documentation on Laravel mail headers is at https://laravel.com/docs/10.x/mail#headers.