What is the format accepted by System.Net.Mail.MailAddress' parser?

前端 未结 2 2106
礼貌的吻别
礼貌的吻别 2021-02-09 00:57

I\'m working on an app that\'s using System.Net.Mail.MailAddress and friends for sending emails. Does that parser implement the full RFC5322 or a subset or what? The MSDN is not

2条回答
  •  温柔的废话
    2021-02-09 01:28

    In the discussion thread on Dominic Sayers isemail article, Jerry O'Brien said that he read Dominic's RFC compliance test cases against the System.Net.MailAddress class:

    System.Net.MailAddress is only 59% compliant with the RFC specifications. Follow-up comments noted the specific cases where it generated false positives and false negatives.

    The RFCs are extremely weak on what constitutes a valid email email address. They allow a range of unusual and unpopular formats. So I guess the real question is, is System.Net.MailAddress good enough in a majority of real-world situations?

提交回复
热议问题