外出回复将发送至“from”地址,“不回复”

发布于 2024-09-08 16:11:29 字数 1540 浏览 1 评论 0原文

我使用通用电子邮件地址向三个不同地点的客户发送电子邮件。任何错误/不在办公室的回复应发送至当地办事处以供他们处理。所以我使用:

来自: [email protected] 回复:[电子邮件受保护]

来自:[电子邮件受保护] 回复:[电子邮件受保护]

来自:[电子邮件受保护] 回复: [email protected]

这似乎对于电子邮件失败很有效(地址错误等)但来自 Exchange 的外出回复始终发送至发件人地址 [电子邮件受保护]。我需要他们去当地办公室,回复地址。

知道我该如何解决这个问题吗?我正在使用标准 MailMessage 从 C# 发送电子邮件:

MailMessage mail = new 
mail.Subject = mailDetail["subject"].ToString();
mail.Body = mailDetail["body"].ToString();

// From 
mail.From = new MailAddress(ConfigManager.GetSetting("MailSender"));

// Reply to (boucebacks / out of office etc)
mail.ReplyTo = new MailAddress(mailDetail["reply_to"].ToString());
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;

感谢您的帮助,

Ryan

I am sending emails to clients in three different locations, using a common email address. Any errors/ out of office replies should go to local offices for them to deal with. So I use:

from: [email protected]
reply-to: [email protected]

from: [email protected]
reply-to: [email protected]

from: [email protected]
reply-to: [email protected]

This seems to work well for email fails (wrong adddress, etc.) but Out of Office replies from Exchange always go to the sender address, [email protected]. I need them to go to the local office, reply-to address.

Any idea how I can solve this? I am sending the email from c#, using the standard MailMessage:

MailMessage mail = new 
mail.Subject = mailDetail["subject"].ToString();
mail.Body = mailDetail["body"].ToString();

// From 
mail.From = new MailAddress(ConfigManager.GetSetting("MailSender"));

// Reply to (boucebacks / out of office etc)
mail.ReplyTo = new MailAddress(mailDetail["reply_to"].ToString());
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;

Thanks for any help,

Ryan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

も让我眼熟你 2024-09-15 16:11:36

由响应邮件的任何人/事物来选择最适合使用的属性。如果是真正的回复,当然应该使用 reply-to 属性,但错误消息可能不会被视为回复,因此 from 属性可用于在某些情况下。如您所见,根据回答者/内容以及原因,您将得到不同的结果。

您可以使用 Sender 属性来指定实际发件人,作为 from 属性的补充。如果处理得当,如果没有使用 reply-to 属性,错误消息应该出现在此处。

It's up to anyone/thing that responds to the mail to choose which property is most appropriate to use. The reply-to property should of course be used if it's a real reply, but an error message might not be seen as a reply, so the from property may be used for that in some cases. As you see, you will get different results depending on who/what is answering, and why.

You can use the Sender property to specify the actual sender as an addition to the from property. If it's handled properly, that is where the error messages should go if the reply-to property isn't used.

依 靠 2024-09-15 16:11:34

这是一个 RFC/标准。
https://www.rfc-editor.org/rfc/rfc3834

  1. 发送地点自动响应(以及不发送它们的位置)

一般来说,自动响应应该发送到返回路径
字段(如果在交付后生成)。如果生成响应
在传递之前,响应应该发送到反向路径
从 SMTP MAIL FROM 命令,或(在非 SMTP 系统中)到
信封返回地址,用作非目的地
交货报告。

如果是发送后生成响应,并且没有
主题消息中的Return-Path字段,有一个实现
或者传送邮件的 SMTP 服务器中的配置错误
或在 SMTP 外部网关发送邮件。个人或团体
响应者不应向除以下地址以外的任何地址发送响应:
在 Return-Path 字段中,即使 Return-Path 字段是
丢失的。最好解决邮件投递问题
系统而不是依靠启发式猜测适当的
响应的目的地。众所周知,这种启发式方法
造成过去的问题。

服务响应者可以将响应传递到以下地址:
>From 字段,或请求负载中的另一个地址,
前提是这种行为在规范中被精确定义
那个服务。服务响应者不应使用 Reply-To 字段
为此目的。

Reply-To 字段不应该用作
来自个人或群组响应者的自动响应。一般来说,
该字段由人类发件人根据他/她对

摩尔标准轨道的预期设置 [第 12 页]

RFC 3834 自动电子邮件回复 2004 年 8 月

人类收件人将如何响应该邮件的具体内容
信息。例如,人类发件人可以使用 Reply-To 来请求
将回复发送到整个邮件列表。即使是回复
对于人类来说,有些情况下不宜做出反应
回复地址,特别是如果发件人要求这样做
回复将发送到群组和/或邮件列表。由于个人或
Group Responder 代表人类接收者进行操作,更安全
假设消息中存在的任何 Reply-To 字段都是由
人类发件人假设任何回复都来自人类
对发件人和其他人的角色有一定了解的人
收件人。自动应答器缺乏必要的信息
了解这些角色。向 Reply-To 发送自动回复
因此,地址可能会导致大量人收到
无用或不需要的消息;它还可能导致邮件循环。

使用“发件人”字段作为自动响应的目标
一些与使用 Reply-To 相同的问题。特别是,
发件人字段可以列出多个地址,同时自动回复
只能发送到一个地址。一般来说,From 和
回复地址有多种使用方式,具体取决于
不同的情况,因此个人或团体
响应者无法可靠地假设“发件人”或“发件人”中的地址
Reply-To 字段是响应的适当目的地。为了
由于这些原因,From 字段不应该用作
自动回复。

同样,发件人字段不应用作
自动回复。该字段仅用于识别
发送消息的个人或实体,并且不需要
包含对回复有效的地址。

返回路径地址确实是消息中唯一的地址
作为协议问题,可以预期合适的标头
对于发件人未预料到的自动响应。

It's an RFC/Standard.
https://www.rfc-editor.org/rfc/rfc3834

  1. Where to send automatic responses (and where not to send them)

In general, automatic responses SHOULD be sent to the Return-Path
field if generated after delivery. If the response is generated
prior to delivery, the response SHOULD be sent to the reverse-path
from the SMTP MAIL FROM command, or (in a non-SMTP system) to the
envelope return address which serves as the destination for non-
delivery reports.

If the response is to be generated after delivery, and there is no
Return-Path field in the subject message, there is an implementation
or configuration error in the SMTP server that delivered the message
or gatewayed the message outside of SMTP. A Personal or Group
responder SHOULD NOT deliver a response to any address other than
that in the Return-Path field, even if the Return-Path field is
missing. It is better to fix the problem with the mail delivery
system than to rely on heuristics to guess the appropriate
destination of the response. Such heuristics have been known to
cause problems in the past.

A Service Responder MAY deliver the response to the address(es) from
the >From field, or to another address from the request payload,
provided this behavior is precisely defined in the specification for
that service. Services responders SHOULD NOT use the Reply-To field
for this purpose.

The Reply-To field SHOULD NOT be used as the destination for
automatic responses from Personal or Group Responders. In general,
this field is set by a human sender based on his/her anticipation of

Moore Standards Track [Page 12]

RFC 3834 Automatic E-Mail Responses August 2004

how human recipients will respond to the specific content of that
message. For instance, a human sender may use Reply-To to request
that replies be sent to an entire mailing list. Even for replies
from humans, there are cases where it is not appropriate to respond
to the Reply-To address, especially if the sender has asked that
replies be sent to a group and/or mailing list. Since a Personal or
Group Responder operates on behalf of a human recipient, it is safer
to assume that any Reply-To field present in the message was set by a
human sender on the assumption that any reply would come from a human
who had some understanding of the roles of the sender and other
recipients. An automatic responder lacks the information necessary
to understand those roles. Sending automatic responses to Reply-To
addresses can thus result in a large number of people receiving a
useless or unwanted message; it can also contribute to mail loops.

Use of the From field as the destination for automatic responses has
some of the same problems as use of Reply-To. In particular, the
From field may list multiple addresses, while automatic responses
should only be sent to a single address. In general, the From and
Reply-To addresses are used in a variety of ways according to
differing circumstances, and for this reason Personal or Group
Responders cannot reliably assume that an address in the From or
Reply-To field is an appropriate destination for the response. For
these reasons the From field SHOULD NOT be used as a destination for
automatic responses.

Similarly, the Sender field SHOULD NOT be used as the destination for
automatic responses. This field is intended only to identify the
person or entity that sent the message, and is not required to
contain an address that is valid for replies.

The Return-Path address is really the only one from the message
header that can be expected, as a matter of protocol, to be suitable
for automatic responses that were not anticipated by the sender.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文