我注意到从我的服务器发送的电子邮件的标题中有重复的“主题”标签。我正在使用 htmlMimeMail5 库。
这是我处理邮件的几行代码
$mail = new htmlMimeMail5();
$mail->setFrom($sender);
if ($ccRecipient) {
$mail->setCc($ccRecipient);
}
$mail->setSubject($subject);
$mail->setPriority('high');
$mail->setHtml($html, ROOT_FOLDER . '/');
$mail->setText(strip_tags($html));
if (sizeof($attachments) > 0) {
foreach($attachments as $name => $path) {
if (file_exists($path) AND !is_dir($path)) {
$mail->addAttachment(new fileAttachment($path, $name));
}
}
}
$mail->setTextCharset('utf-8');
$mail->setHTMLCharset('utf-8');
$mail->setHeadCharset('utf-8');
if($replyTo){
$mail->setHeader('Reply-To', $replyTo);
}
$sent = $mail->send(array($sendTo));
和结果
...
To: xxx@xxx.com
Subject: =?utf-8?B?WmF6bm*tZW5hbmEgdWhyY****HphIHByZWRmYWt*dXJ1?=
MIME-Version: 1.0
X-Mailer: Mailer
From: xxx <xxx@xxx.com>
Subject: some subject
...
第一个主题中有一些东西,可能是什么,为什么会出现?(为了以防万一,我用几个字符替换了“*”)它会因此被视为垃圾邮件吗?
谢谢