php - DKMI 使用 phpmailer 无效
问题描述
我正在使用 php mailer 从我的办公室邮件地址发送邮件。当我发送消息时,DKIM 签名无效。
try {
//Server settings
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
$mail->isSMTP(); // Send using SMTP
$mail->Host = MAIL_HOST; // Set the SMTP server to send through
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = MAIL_USER; // SMTP username
$mail->Password = MAIL_PASSWORD; // SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted
$mail->Port = MAIL_PORT; // TCP port to connect to
$mail -> charSet = "UTF-8";
//Recipients
$mail->setFrom(MAIL_USER);
$mail->addAddress('test-xxxxx@srv1.mail-tester.com', 'test-xxxx@srv1.mail-tester.com'); // Add a recipient
// Attachments
//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'subject';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->Body = "My Content";
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
该消息将发送而没有任何错误,但我的 DKIM 无效。我无法创建新的 dkmi 私钥,因为我的办公室不允许我创建它。
为什么来自 mail Outlook 或 Outlook Web 邮件程序的邮件具有有效的 dkmi 签名?我正在使用微软的 office365 来发送我的邮件。
我该如何解决这个问题?
解决方案
推荐阅读
- python - 如何在我的代码中修复“IndexError:列表索引超出范围”?
- excel - 选择的自动调整列宽
- scala - Scala/Java:比较两个列表/集合并从两个列表中删除匹配的元素
- python - 如何检查变量是否具有相同的值并将其作为python中的一个值返回
- java - 在线编译器不会运行超过一个类
- c# - 如何使用 Restsharp 连接到 API
- postgresql - 无法使用 aws_commons 扩展将 s3 数据导入 RDS(Postgresql)
- apache-spark - 如何在Dataset中返回json数据
在 Spark 中使用编码器(structType)?
- reactjs - 部署到 Heroku 时如何预编译/修复 CSS 不一致?
- reactjs - reactjs 下拉菜单关闭打开的菜单