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/