[英]System.Net.Mail.MailAddress validates email missing TLD, considers me@there valid
Considers me@there valid. 认为我@有效。 Is not a TLD required? 是否不需要TLD?
try
{
foreach (var email in addresses)
{
var addr = new System.Net.Mail.MailAddress(email);
}
}
catch (Exception)
{
return "Invalid email address";
}
According to the spec 根据规格
http://www.ietf.org/rfc/rfc822.txt http://www.ietf.org/rfc/rfc822.txt
It's indeed valid. 确实是有效的。
Is not a TLD required? 是否不需要TLD?
No. 没有。
See, just because THE INTERNET does it so, oes not mean I can not work with direct host names in my own network. 瞧,仅仅因为THE INTERNET就是这样做的,所以这并不意味着我不能在自己的网络中使用直接主机名。 Expecially given that default DNS domain (added from the IP settings) may "remap" @there into @there.local transparently ;) 特别是考虑到默认的DNS域(从IP设置中添加)可能会透明地将@there重新映射到@ there.local;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.