我们在域(domain1.com)上有一个网站。我们希望使用PHPMailer从该网站发送电子邮件。我们正在使用1&1 Ionos(smtp.ionos.co.uk)对SMTP服务器进行身份验证。此SMTP服务器不用于domain1.com,而是用于domain2.com。
该网站位于domain1.com上,但我们试图通过domain2.com的邮件服务器发送邮件的原因是,由于某种原因,我们客户的IT支持无法为我们提供domain1.com的SMTP。
当我们使用domain2.com的SMTP从domain1.com发送电子邮件时,该电子邮件将转到垃圾邮件/垃圾邮件文件夹。
我相信通过有效的SMTP服务器发送邮件时,它将到达收件箱。我们尚未设置SPF记录,因为我不确定应该是什么:
我注意到我还收到了5的SCL。
$mail->SMTPDebug = 3;
$mail->isSMTP();
$mail->Host = 'smtp.ionos.co.uk';
$mail->SMTPAuth = true;
$mail->Username = 'website@domain2.com';
$mail->Password = '[PASSWORD]';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
//Recipients
$mail->setFrom('website@domain2.com', 'Sender');
$mail->addAddress('info@domain3.com', 'Receiver');
// Content
$mail->isHTML(true);
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
我希望结果是收件箱中收到发送到info@domain3.com的电子邮件,发件人是website@domain2.com。
实际结果是它到达垃圾邮件文件夹中。
以下是PHPMailer的输出: (我们正在使用的域已替换为domain1.com和domain2.com。
2019-07-19 12:51:12 Connection: opening to smtp.ionos.co.uk:587, timeout=300, options=array()
2019-07-19 12:51:12 Connection: opened
2019-07-19 12:51:12 SERVER -> CLIENT: 220 kundenserver.de (mreue010) Nemesis ESMTP Service ready
2019-07-19 12:51:12 CLIENT -> SERVER: EHLO domain1.com
2019-07-19 12:51:12 SERVER -> CLIENT: 250-kundenserver.de Hello domain1.com [109.228.60.45]250-8BITMIME250-AUTH LOGIN PLAIN250-SIZE 69920427250 STARTTLS
2019-07-19 12:51:12 CLIENT -> SERVER: STARTTLS
2019-07-19 12:51:13 SERVER -> CLIENT: 220 OK
2019-07-19 12:51:13 CLIENT -> SERVER: EHLO domain1.com
2019-07-19 12:51:13 SERVER -> CLIENT: 250-kundenserver.de Hello domain1.com [109.228.60.45]250-8BITMIME250-AUTH LOGIN PLAIN250 SIZE 69920427
2019-07-19 12:51:13 CLIENT -> SERVER: AUTH LOGIN
2019-07-19 12:51:13 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2019-07-19 12:51:13 CLIENT -> SERVER: <credentials hidden>
2019-07-19 12:51:13 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2019-07-19 12:51:13 CLIENT -> SERVER: <credentials hidden>
2019-07-19 12:51:13 SERVER -> CLIENT: 235 Authentication succeeded
2019-07-19 12:51:13 CLIENT -> SERVER: MAIL FROM:<website@domain2.com>
2019-07-19 12:51:13 SERVER -> CLIENT: 250 Requested mail action okay, completed
2019-07-19 12:51:13 CLIENT -> SERVER: RCPT TO:<info@domain3.com>
2019-07-19 12:51:13 SERVER -> CLIENT: 250 OK
2019-07-19 12:51:13 CLIENT -> SERVER: DATA
2019-07-19 12:51:13 SERVER -> CLIENT: 354 Start mail input; end with <CRLF>.<CRLF>
2019-07-19 12:51:13 CLIENT -> SERVER: Date: Fri, 19 Jul 2019 12:51:12 +0000
2019-07-19 12:51:13 CLIENT -> SERVER: To: Receiver <info@domain3.com>
2019-07-19 12:51:13 CLIENT -> SERVER: From: Sender <website@domain2.com>
2019-07-19 12:51:13 CLIENT -> SERVER: Subject: Here is the subject
2019-07-19 12:51:13 CLIENT -> SERVER: Message-ID: <pBl5X5mLOx1thDYn6AUiNl4bjQ670HqkyflaaOGMH9I@domain1.com>
2019-07-19 12:51:13 CLIENT -> SERVER: X-Mailer: PHPMailer 6.0.7 (https://github.com/PHPMailer/PHPMailer)
2019-07-19 12:51:13 CLIENT -> SERVER: MIME-Version: 1.0
2019-07-19 12:51:13 CLIENT -> SERVER: Content-Type: multipart/alternative;
2019-07-19 12:51:13 CLIENT -> SERVER: boundary="b1_pBl5X5mLOx1thDYn6AUiNl4bjQ670HqkyflaaOGMH9I"
2019-07-19 12:51:13 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2019-07-19 12:51:13 CLIENT -> SERVER:
2019-07-19 12:51:13 CLIENT -> SERVER: This is a multi-part message in MIME format.
2019-07-19 12:51:13 CLIENT -> SERVER: --b1_pBl5X5mLOx1thDYn6AUiNl4bjQ670HqkyflaaOGMH9I
2019-07-19 12:51:13 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii
2019-07-19 12:51:13 CLIENT -> SERVER:
2019-07-19 12:51:13 CLIENT -> SERVER: This is the body in plain text for non-HTML mail clients
2019-07-19 12:51:13 CLIENT -> SERVER:
2019-07-19 12:51:13 CLIENT -> SERVER: --b1_pBl5X5mLOx1thDYn6AUiNl4bjQ670HqkyflaaOGMH9I
2019-07-19 12:51:13 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii
2019-07-19 12:51:13 CLIENT -> SERVER:
2019-07-19 12:51:13 CLIENT -> SERVER: This is the HTML message body <b>in bold!</b>
2019-07-19 12:51:13 CLIENT -> SERVER:
2019-07-19 12:51:13 CLIENT -> SERVER:
2019-07-19 12:51:13 CLIENT -> SERVER: --b1_pBl5X5mLOx1thDYn6AUiNl4bjQ670HqkyflaaOGMH9I--
2019-07-19 12:51:13 CLIENT -> SERVER:
2019-07-19 12:51:13 CLIENT -> SERVER: .
2019-07-19 12:51:13 SERVER -> CLIENT: 250 Requested mail action okay, completed: id=1MHXWL-1havq40lUn-00DZMt
2019-07-19 12:51:13 CLIENT -> SERVER: QUIT
2019-07-19 12:51:13 SERVER -> CLIENT: 221 kundenserver.de Service closing transmission channel
2019-07-19 12:51:13 Connection: closed
Message has been sent
这是收到的电子邮件的标题:
Received: from CWXP265MB1255.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:53::17)
by CWLP265MB1252.GBRP265.PROD.OUTLOOK.COM with HTTPS via
CWLP265CA0125.GBRP265.PROD.OUTLOOK.COM; Fri, 19 Jul 2019 08:48:43 +0000
Received: from LO2P265CA0346.GBRP265.PROD.OUTLOOK.COM (20.176.151.150) by
CWXP265MB1255.GBRP265.PROD.OUTLOOK.COM (20.176.46.18) with Microsoft SMTP
Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.2073.14; Fri, 19 Jul 2019 08:48:41 +0000
Received: from LO2GBR01FT016.eop-gbr01.prod.protection.outlook.com
(2a01:111:f400:7e15::205) by LO2P265CA0346.outlook.office365.com
(2603:10a6:600:d::22) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.14 via Frontend
Transport; Fri, 19 Jul 2019 08:48:41 +0000
Authentication-Results: spf=none (sender IP is 212.227.126.130)
smtp.mailfrom=domain2.com; domain3.com; dkim=none (message not signed)
header.d=none;domain3.com; dmarc=none action=none
header.from=domain2.com;compauth=fail reason=001
Received-SPF: None (protection.outlook.com: domain2.com does not
designate permitted sender hosts)
Received: from mout.kundenserver.de (212.227.126.130) by
LO2GBR01FT016.mail.protection.outlook.com (10.152.42.102) with Microsoft SMTP
Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id
15.20.2052.18 via Frontend Transport; Fri, 19 Jul 2019 08:48:41 +0000
Received: from domain1.com ([REDACTED]) by mrelayeu.kundenserver.de
(mreue011 [213.165.67.99]) with ESMTPSA (Nemesis) id
1Mt7Ll-1ih3S51mbR-00tR6X; Fri, 19 Jul 2019 10:48:40 +0200
Date: Fri, 19 Jul 2019 08:48:40 +0000
To: Domain 3 <info@domain3.com>
From: Domain 2 <website@domain2.com>
Reply-To: Sender <support@domain3.com>
Subject: New Contact Form Submission
Message-ID: <Lf43d2831QWJXJRRec3pYAMiqXeMEtR7loF8JA@domain1.com>
X-Mailer: PHPMailer 6.0.7 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_Lf43d2831QWJXJR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rGhOuFFcyk
VnWMkV/8m3zbXisMLNViHmKZ8N1cxaLDO97TmywwCE+m53sbVOFWRarREkUYWRJ73qdiDRi6j
vokIIXk
Return-Path: website@domain2.com
X-MS-Exchange-Organization-ExpirationStartTime: 19 Jul 2019 08:48:41.5122
(UTC)
X-MS-Exchange-Organization-ExpirationStartTimeReason: OriginalSubmit
X-MS-Exchange-Organization-ExpirationInterval: 1:00:00:00.0000000
X-MS-Exchange-Organization-ExpirationIntervalReason: OriginalSubmit
X-MS-Exchange-Organization-Network-Message-Id:
e5cc4072-a21c-491e-23f6-08d70c25e668
X-EOPAttributedMessage: 0
X-EOPTenantAttributedMessage: a22d5c75-6de1-4404-8670-f8b904f670b7:0
X-MS-Exchange-Organization-MessageDirectionality: Incoming
X-Forefront-Antispam-Report:
CIP:212.227.126.130;IPV:NLI;CTRY:DE;EFV:NLI;SFV:SPM;SFS:(2980300002)(428003)(52294003)(199004)(189003)(43066004)(36756003)(3480700005)(9686003)(67896002)(55016002)(63394003)(5566004)(71850400003)(7596002)(305945005)(6916009)(40080500001)(7636002)(2160300002)(5660300002)(122186004)(8676002)(54206008)(86362001)(5000100001)(246002)(2870700001)(53416004)(16003)(356004)(71816002)(4326008)(1096003)(7696005)(50226002)(23466002)(107886003)(69370400003);DIR:INB;SFP:;SCL:5;SRVR:CWXP265MB1255;H:mout.kundenserver.de;FPR:;SPF:None;LANG:en;PTR:mout.kundenserver.de;A:1;MX:1;CAT:SPOOF;
X-MS-Exchange-Organization-AuthSource:
LO2GBR01FT016.eop-gbr01.prod.protection.outlook.com
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: e5cc4072-a21c-491e-23f6-08d70c25e668
X-Microsoft-Antispam:
BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(5600148)(711020)(4605104)(71702078);SRVR:CWXP265MB1255;
X-MS-TrafficTypeDiagnostic: CWXP265MB1255:
X-MS-Oob-TLC-OOBClassifiers: OLM:1051;
X-MS-Exchange-Organization-SCL: 6
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2019 08:48:41.4011
(UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e5cc4072-a21c-491e-23f6-08d70c25e668
X-MS-Exchange-CrossTenant-Id: a22d5c75-6de1-4404-8670-f8b904f670b7
X-MS-Exchange-CrossTenant-FromEntityHeader: Internet
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP265MB1255
X-MS-Exchange-Transport-EndToEndLatency: 00:00:02.1609191
X-MS-Exchange-Processed-By-BccFoldering: 15.20.2073.000
X-Microsoft-Antispam-Mailbox-Delivery:
ucf:0;jmr:1;ex:0;auth:0;dest:J;ENG:(20160513016)(750119)(520011016)(944506303)(944626516);
X-Microsoft-Antispam-Message-Info:
=?us-ascii?Q?530gbum92oE5lxvxGHFjKTvwkNuNbrN4ZTsC9nRXRvWpPqm+01yKW0yUD2ow?=
=?us-ascii?Q?5U9/4DgeElUN3h75zsB43re/jDU2tjLnrrnb+3Tsib4iSwRB0+lALuJ9SuH5?=
=?us-ascii?Q?DBByCazGMIO8rOPoz+C5/SUMvAVbj3UkCq+8BataVN0o4KMcEy0ZURngr+2p?=
=?us-ascii?Q?klq26wdJ5vZYBWaocbnWiYYU5lH2creeZrU1E+mP/vSsm5/aPrJFxorLMsO3?=
=?us-ascii?Q?2uYKWb7SJlBvCm8xAUCXEG7loXVeiAtgAZIIxeiINyVHkdE1tVst3XUazndP?=
=?us-ascii?Q?2T7BocHQe7k88O/OUZMMtelSJFTPWs7fdRyA42DETNxqDMFuLR70YrxjKEwU?=
=?us-ascii?Q?CXm6obMxzRhAYdKzzuYCVq/DjggHe970d2EBf976pAILp8fG0qttHBgESesT?=
=?us-ascii?Q?iN3WkgYGE+cgSVRhkE4TVNYjLreDlv2Pm768AQanWbpxdfnGCYPk2Zj72yoy?=
=?us-ascii?Q?Ta65m/8oDLgXKPy3/iZhsR41Si3G1XrO4CJZaNzugt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