这是我写的代码,
$mail = new PHPMailer;
$mail->MessageID = $message_send_id;
// Set PHPMailer to use the sendmail transport
$mail->isSendmail();
$mail->isHTML(true); // Set email format to HTML
$mail->AddReplyTo(trim($_GET["in_rep_to"]));
$mail->addCustomHeader("List-Unsubscribe: <mailto:unsubscribe@lovenlove.info?subject=delete>,<http://lovenlove.info/nishat/unsubscribe.php?email=".$value[0]["address"].">");
//Set who the message is to be sent from
$mail->setFrom(trim($email_address), trim($value[0]["own_name"]));
//Set the hostname of the mail server
$mail->Hostname = trim($host_name);
$mail->addCustomHeader('In-Reply-To', $message_id);
$mail->addCustomHeader('References', $ref_id);
//mail addresscontains <*> this line to be edited
$mail->addAddress(trim($value[0]["address"]));
//Set the subject line
//code for subject here
$subject = $value[0]["message_to_send"]["subject"];
//code for body
$body = $value[0]["message_to_send"]["body"];
$mail->Subject = trim($subject);
$mail->Body = trim($body);
//send the message, check for errors
if (!$mail->send()) echo "Mailer Error: " . $mail->ErrorInfo;
这会使用电子邮件发送标头List-Unsubscribe
,但链接未显示在那里。我不知道这是不是这个过程。
我有DKIM: PASS
和SPF: NEUTRAL
记录。
在邮件标题中显示List-Unsubscribe: <mailto:unsubscribe@lovenlove.info?subject=delete>,<http://lovenlove.info/nishat/unsubscribe.php?email=heatherb6353@gmail.com>
。我找不到问题。