如何将 List-Unsubscribe header 添加到 PHP 的本机 mail() 函数
How add List-Unsubscribe header to native mail() function of PHP
我已经在 https://www.mail-tester.com/ 上测试了我的垃圾邮件分数。这很好,但作为一个证明,它建议:
Your message does not contain a List-Unsubscribe header The
List-Unsubscribe header is required if you send mass emails, it
enables the user to easily unsubscribe from your mailing list.
如何将其添加到 PHP 的原生 mail();
函数中。或者甚至有可能这样吗? (我在 www 上找不到一个简单的例子)。
您可以使用 mail() 函数添加额外的 headers。
$headers = [
'From: thisisme@example.net',
'List-Unsubscribe: <mailto:thisisme@example.net?subject=unsubscribe>'
];
$body = 'I am the newsletter content.';
mail('recipent@example.net', 'Subject of newsletter', $body, implode("\r\n", $headers));
我已经在 https://www.mail-tester.com/ 上测试了我的垃圾邮件分数。这很好,但作为一个证明,它建议:
Your message does not contain a List-Unsubscribe header The List-Unsubscribe header is required if you send mass emails, it enables the user to easily unsubscribe from your mailing list.
如何将其添加到 PHP 的原生 mail();
函数中。或者甚至有可能这样吗? (我在 www 上找不到一个简单的例子)。
您可以使用 mail() 函数添加额外的 headers。
$headers = [
'From: thisisme@example.net',
'List-Unsubscribe: <mailto:thisisme@example.net?subject=unsubscribe>'
];
$body = 'I am the newsletter content.';
mail('recipent@example.net', 'Subject of newsletter', $body, implode("\r\n", $headers));