1

我已经在https://www.mail-tester.com/上测试了我的垃圾邮件分数。这很好,但作为一种建议,它建议:

您的邮件不包含 List-Unsubscribe 标头 如果您发送大量电子邮件,则需要 List-Unsubscribe 标头,它使用户能够轻松地从您的邮件列表中取消订阅。

如何将其添加到mail();PHP 的本机函数中。或者甚至有可能这样吗?(我在 www 上找不到一个简单的例子)。

4

1 回答 1

2

您可以使用mail()函数添加其他标题。

$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));
于 2021-03-31T20:04:41.837 回答