Open berggrenmille opened 1 month ago
A regular expression that claims to be fully RFC 822-compliant can be found here:
https://pdw.ex-parrot.com/Mail-RFC822-Address.html
RFC 5322 is simpler, and generates a shorter RegEx:
In C#, it is simpler to check the validity of the address, by trying to instantiate a MailAddress:
try {
address = new MailAddress(address).Address;
} catch(FormatException) {
// address is invalid
}