CodeExplorer formatMailAddresses example
array
$sender,
array
$recipients,
array
$contents,
array
$attachments,
array
$additionalData,
?array
$binAttachments = null
): Email
{ $this->
assertValidAddresses(array_keys($recipients));
$mail =
(new Mail()) ->
subject($subject) ->
from(...
$this->
formatMailAddresses($sender)) ->
to(...
$this->
formatMailAddresses($recipients)) ->
setMailAttachmentsConfig($additionalData['attachmentsConfig'
] ?? null
);
foreach ($contents as $contentType =>
$data) { if ($contentType === 'text/html'
) { $mail->
html($data);
} else { $mail->
text($data);
} }