I don't use the Symfony Framework. When I add my header like
$mail = (new Email())
->from(new Address('[email protected]', 'Name'))
->to($recipient)
->subject($subject)
->html($body)
->getHeaders()
->addTextHeader('X-Auto-Response-Suppress', 'OOF, DR, RN, NRN, AutoReply');
then a $mailer->send($mail); doesn't work anymore:-(
How do I send mail?
getHeaders function returns the Headers, so in your $mail, you dont have an email but Headers
$mail = (new Email())
->from(new Address('[email protected]', 'Name'))
->to($recipient)
->subject($subject)
->html($body);
$mail->getHeaders()->addTextHeader('X-Auto-Response-Suppress', 'OOF, DR, RN, NRN, AutoReply');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With