简体   繁体   English

System.Net.Mail.MailAddress验证电子邮件缺少TLD,认为我@有效

[英]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.

相关问题 RegEx由System.Net.Mail.MailAddress使用 - Is RegEx used by System.Net.Mail.MailAddress 为什么 System.Net.Mail.MailAddress 构造函数在域部分解析带有斜杠“/”的电子邮件? - Why System.Net.Mail.MailAddress constructor parses email with slash "/" in domain part? 无法将System.Net.Mail.MailAddress序列化为Json - Unable to serialize System.Net.Mail.MailAddress to Json System.Net.Mail.MailAddress使用一个参数发送到多封电子邮件 - System.Net.Mail.MailAddress send to multiple emails with one parameter System.Net.Mail.MailAddress不允许Gmail GROUP联系人 - System.Net.Mail.MailAddress does not allow Gmail GROUP contact 无法将类型“System.Net.Mail.MailAddress”隐式转换为“SendGrid.Helpers.Mail.EmailAddress” - Cannot implicitly convert type 'System.Net.Mail.MailAddress' to 'SendGrid.Helpers.Mail.EmailAddress' 使用System.Net.Mail.MailAddress或其他库指定.eml文件名 - Specify .eml file name using System.Net.Mail.MailAddress or other library 是“ a @ bbb..com”有效的电子邮件地址吗?,根据MailAddress类,它是 - Is it “a@bbb..com” a valid email address?, According to MailAddress class it is 为什么 MailAddress 认为“john@gmail”。 是一个有效的电子邮件地址吗? - Why does MailAddress think 'john@gmail.' is a valid email address? asp email System.Net.Mail - asp email System.Net.Mail
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM