Add Auto-Submitted E-mail header as per RFC 8384

This commit is contained in:
Frédéric Guillot 2019-04-27 20:33:53 -07:00 committed by fguillot
parent a9c79fbc43
commit d6ffe08aeb
1 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,11 @@ class Mail extends Base implements ClientInterface
->setFrom($this->helper->mail->getMailSenderAddress(), $authorName)
->setTo(array($recipientEmail => $recipientName));
$headers = $message->getHeaders();
// See https://tools.ietf.org/html/rfc3834#section-5
$headers->addTextHeader('Auto-Submitted', 'auto-generated');
if (! empty($authorEmail)) {
$message->setReplyTo($authorEmail);
}