asp.net - 无法发送带有加号的电子邮件(来自 System.Net.Mail 的 SmtpClient.Send() 方法)

标签 asp.net asp.net-mvc email smtpclient system.net.mail

System.Net.Mail 中的 SmtpClient.Send() 方法真的不能发送到其中包含加号的电子邮件地址吗?我发送到一个电子邮件地址列表,除了包含加号 (+) 的地址外,它们都被发送了。有什么想法或解决方法吗?

最佳答案

我使用带有 .net 4 的 System.Net.Mail 成功地向地址中带有 + 字符的收件人发送了电子邮件。

在我的例子中,收件人是 gmail 地址,其中 + 和它后面的任何字符都不会更改收件人。因此 something+somethingelse@gmail.com 发送了一封电子邮件,该电子邮件由 something@gmail.com 帐户接收。但是该帐户可以看到它已发送到 something+somethingelse

我认为这实际上是一个 sendmail 标准,而不仅仅是 google 的东西。它派上用场了。

编辑:我找到了一些关于“plussed accounts”的 sendmail 文档:

http://www.sendmail.com/sm/open_source/docs/m4/misc_features.html

Sometimes it is convenient to merge configuration on a centralized mail machine, for example, to forward all root mail to a mail server. In this case it might be useful to be able to treat the root addresses as a class of addresses with subtle differences. You can do this using plussed users. For example, a client might include the alias:

root: root+client1@server

On the server, this will match an alias for "root+client1". If that is not found, the alias "root+*" will be tried, then "root".

关于asp.net - 无法发送带有加号的电子邮件(来自 System.Net.Mail 的 SmtpClient.Send() 方法),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11632415/

相关文章:

c# - 使用 ASP.NET Session 进行生命周期管理 (Unity)

javascript - 将客户端值传递给服务器端

c# - 如何确定由 Google 翻译翻译的网页的新语言?

asp.net - 自定义 Elmah YSOD 数据

javascript - 将列表的元组设置为 ViewData Mvc C#

asp.net-mvc - 抽象 CRUD Controller 是个好主意吗?

Python:发送带有嵌入式图像和附件的多部分 html 电子邮件

asp.net-mvc - 如何在 WEB API 2 中创建异步验证属性

c# - 使用 System.Net.Mail 唯一标识发送的电子邮件

javascript - TypeError : e. preventDefault 不是 React Hook Form 上使用 EmailJs 的函数