发送邮件时,如果邮件失败/退回,则需要将这些失败/退回的邮件发送到指定的邮件地址,而不是使用 ASP.NET C# 中的 Microsoft Graph API 从地址发送。
我尝试添加退回邮件地址,但在 Microsoft Graph 中没有输入退回邮件地址的选项。
您所说的是用于发送 NDR 的消息的 Return-Path 属性。虽然拥有不同的返回路径是有效的,并且对于邮件列表来说是可取的,但 RFC 声明https://datatracker.ietf.org/doc/html/rfc2821 states
A message-originating SMTP system SHOULD NOT send a message that
already contains a Return-path header. SMTP servers performing a
relay function MUST NOT inspect the message data, and especially not
to the extent needed to determine if Return-path headers are present.
SMTP servers making final delivery MAY remove Return-path headers
before adding their own
因此,为了符合要求,图表不应允许您执行此操作,返回路径中最终应该是(信封)P1“邮件发件人”标头。因此,如果您确实需要这样做,则需要考虑使用 SMTP。