The following code throws an exception of "An invalid character was found in the mail header: 'ñ'.":
string email = "ñ@c.com";
MailAddress to = new MailAddress(email);
The actual address I'm running into this is a valid address, but the MailAddress class throws an error whenever I try and use it.
Based on the result above, the regex has validated emails with .com, . net, and . gov as valid addresses.
Invalid email addresses belong to inactive recipients who don't engage with your content. The unengaged email addresses can be invalid for a few reasons: Invalid emails can have typos or misformatting that do not lead to a legitimate inbox.
An email address also may have an associated display name for the recipient, which precedes the address specification, now surrounded by angled brackets, for example: John Smith <[email protected]>.
Yeah, interesting. According to Wikipedia: Email Address, it's strictly defined as being a subset of ASCII, so that is technically invalid.
So, it seems you just strictly can't send email to that address from .NET (using the System.Net.Mail classes, anyway).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With