使用 PHP mail() 函数时,当我在消息中的某处使用“utvecklat”一词时,电子邮件会进入垃圾文件夹。(在哪里都无所谓)
但是,当我从 Outlook 向另一个 Outlook 帐户(在同一邮件服务器中)发送电子邮件时,它会进入收件箱。
因此,我认为问题与邮件标题有关。
我正在使用这个 PHP 代码:
$subject='=?UTF-8?B?'.base64_encode($subject).'?=';
$emailTo="{$toEmail}";
$boundary = md5(date('U'));
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/alternative;boundary={$boundary}\r\n";
$headers .= "From: \"{$fromName}\" <{$fromEmail}>\r\n";
$message = "This is a MIME encoded message.";
$message .= "\r\n\r\n--" . $boundary . "\r\n";
$message .= "Content-type: text/html;charset=utf-8\r\n\r\n";
$message .= $message_tmp;
$message .= "\r\n\r\n--" . $boundary . "--";
mail($emailTo, $subject, $message, $headers, "-f {$fromEmail}");
电子邮件应为 HTML 格式。不管我是否使用“utv ecklat ”,电子邮件都会进入垃圾文件夹。
那么,我应该怎么做才能避免 Outlook 中的垃圾邮件过滤器呢?(必须与我的电子邮件标题有关,因为同一邮件服务器中从 Outlook 到 Outlook 的邮件会进入收件箱。)
谢谢!
更新!
在这里,您有一封从 Outlook 帐户发送到另一个帐户的电子邮件。有人可以将所有这些标头“转换”为正确的 PHP mail() 代码吗?谢谢!
Return-Path: <example@domain.com>
Delivered-To: robin@example.com
Received: from localhost (localhost [127.0.0.1])
by example.example.com (Postfix) with ESMTP id 9C67EC21B12
for <robin@example.com>; Sat, 7 Apr 2012 17:58:14 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at example.example.com
X-Spam-Flag: NO
X-Spam-Score: -2.47
X-Spam-Level:
X-Spam-Status: No, score=-2.47 required=6.31 tests=[ALL_TRUSTED=-1,
BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_HTML_MOSTLY=0.428,
TVD_SPACE_RATIO=0.001] autolearn=ham
Received: from example.example.com ([000.000.000.00])
by localhost (example.example.com [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id HIlqLaU+2IIL for <robin@example.com>;
Sat, 7 Apr 2012 17:58:11 +0200 (CEST)
Received: from Ciccidator (00-000-00-000-no56.tbcn.telia.com [00.00.00.000])
by example.example.com (Postfix) with ESMTPA id 866F2C2059C
for <robin@example.com>; Sat, 7 Apr 2012 17:58:11 +0200 (CEST)
From: "Example Sender" <example@domain.com>
To: <robin@example.com>
Subject: utvecklat
Date: Sat, 7 Apr 2012 17:58:01 +0200
Message-ID: <000001cd14d7$35d38070$a17a8150$@example.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0001_01CD14E7.F95C9E90"
X-Mailer: Microsoft Outlook 14.0
Thread-Index: Ac0U1zWPte9QsazETMuTKG6LDnf1fg==
Content-Language: sv