我通常使用 Windows Server 2008 R2 和 IIS 7.5。我使用 IIS 6 smpt 服务器发送电子邮件。现在,当我通过 C# 应用程序发送电子邮件时,我看到从标题中收到 2 条消息。这可能是什么原因造成的?
显示 Gmail 和 Hotmail 邮件头
邮箱:
Delivered-To: [email protected]
Received: by 10.112.29.167 with SMTP id l7csp43703lbh;
Sat, 10 Mar 2012 08:16:29 -0800 (PST)
Received: by 10.14.127.12 with SMTP id c12mr1026618eei.19.1331396188791;
Sat, 10 Mar 2012 08:16:28 -0800 (PST)
Return-Path: <[email protected]>
Received: from noreply.monstermmorpg.com (noreply.monstermmorpg.com. [85.17.154.139])
by mx.google.com with ESMTP id f41si4528441eeo.146.2012.03.10.08.16.27;
Sat, 10 Mar 2012 08:16:28 -0800 (PST)
Received-SPF: pass (google.com: domain of [email protected] designates 85.17.154.139 as permitted sender) client-ip=85.17.154.139;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 85.17.154.139 as permitted sender) [email protected]
Received: from XCPV002 ([127.0.0.1]) by noreply.monstermmorpg.com with Microsoft SMTPSVC(7.5.7601.17514);
Sat, 10 Mar 2012 16:16:28 +0000
MIME-Version: 1.0
From: "MonsterMMORPG"
<[email protected]>
To: [email protected]
Date: 10 Mar 2012 16:16:28 +0000
Subject: =?utf-8?B?UG9rZW1vbkNyYWZ0IGRhaGEga2FsaXRlbGkgYmlyIG95dW4g?=
=?utf-8?B?b2xhcmFrIGdlcmkgZMO2bmTDvC4gRXNraSBoZXNhYsSxbsSxeiBkdXJ1?=
=?utf-8?B?eW9yLg==?=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
Return-Path: [email protected]
Message-ID: <[email protected]>
X-OriginalArrivalTime: 10 Mar 2012 16:16:28.0941 (UTC) FILETIME=[26372BD0:01CCFED9]
hotmail 邮件头
x-store-info:sbevkl2QZR7OXo7WID5ZcaZ0jeT0hTF6w5JqyzrMGIIJ4/L/t2gj2cA4gOeWpl7k+VkJUhAu0L19pcdx17/6zH+umIRUQcxNC7a6JMdOu4uk+atrpASsFAd6JPSp2WMA
Authentication-Results: hotmail.com; sender-id=temperror (sender IP is 85.17.154.139) [email protected]; dkim=none header.d=monstermmorpg.com; x-hmca=none
X-Message-Status: n:0:n
X-SID-PRA: MonsterMMORPG <[email protected]>
X-DKIM-Result: None
X-AUTH-Result: NONE
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0xO0Q9MTtHRD0xO1NDTD0w
X-Message-Info: NhFq/7gR1vQcnWpWXvTdSPoVLSrfQUf9NNYiD+nue1hb767bbTKXz+tuMD66iU4vKsnCmrISnMcViv7BRc8FinIdJij0qRdzfb9MQFyl8Qnq2jH2yHHz6W3BUjjFUEclGZIdpMuV4EQ=
Received: from noreply.monstermmorpg.com ([85.17.154.139]) by BAY0-MC3-F1.Bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900);
Sat, 10 Mar 2012 08:20:03 -0800
Received: from XCPV002 ([127.0.0.1]) by noreply.monstermmorpg.com with Microsoft SMTPSVC(7.5.7601.17514);
Sat, 10 Mar 2012 16:20:03 +0000
MIME-Version: 1.0
From: "MonsterMMORPG"
<[email protected]>
To: [email protected]
Date: 10 Mar 2012 16:20:03 +0000
Subject: =?utf-8?B?UG9rZW1vbkNyYWZ0IGRhaGEga2FsaXRlbGkgYmlyIG95dW4g?=
=?utf-8?B?b2xhcmFrIGdlcmkgZMO2bmTDvC4gRXNraSBoZXNhYsSxbsSxeiBkdXJ1?=
=?utf-8?B?eW9yLg==?=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
Return-Path: [email protected]
Message-ID: <[email protected]>
X-OriginalArrivalTime: 10 Mar 2012 16:20:03.0608 (UTC) FILETIME=[A62AC180:01CCFED9]
如果你检查一下,你会发现有 2 个来自标题的接收信息。我还想展示一下如何发送电子邮件以及我的 smtp 服务器配置
这就是我发送电子邮件的方式 C#
MailMessage mail = new MailMessage();
mail.To.Add(srEmail);
mail.From = new MailAddress("[email protected]", srSender);
mail.Subject = srEmailTitle;
mail.Body = srEmailBody;
mail.IsBodyHtml = true;
mail.SubjectEncoding = System.Text.Encoding.UTF8;
mail.BodyEncoding = System.Text.Encoding.UTF8;
SmtpClient smtp = new SmtpClient();
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.UseDefaultCredentials = true;
smtp.Host = "127.0.0.1";
smtp.Port = 25;
smtp.Send(mail);
这是 IIS 服务器配置
非常感谢您的帮助
答案1
对于处理邮件的每个 SMTP 服务器,您都会获得一个Received
标头。就您而言,当您的应用程序通过 SMTP 连接到本地主机并首次注入邮件时,您会获得一个标头,而当 IIS 系统将电子邮件传递到 HotMail 或 GMail 服务器时,您会获得第二个标头。
这绝对是正常的,也是意料之中的。