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 very forthcoming on this topic.
Any hints appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve wrote a little snippet to test the function:
With the following results on 3.5 SP1:
MailAddress failed ' ' (32): par.t1 pa.r t2@example.com MailAddress failed ''' (34): par.t1'pa.r't2@example.com MailAddress failed '(' (40): par.t1(pa.r(t2@example.com MailAddress failed ')' (41): par.t1)pa.r)t2@example.com MailAddress failed ',' (44): par.t1,pa.r,t2@example.com MailAddress failed ':' (58): par.t1:pa.r:t2@example.com MailAddress failed ';' (59): par.t1;pa.r;t2@example.com MailAddress failed '<' (60): par.t1<pa.r<t2@example.com MailAddress failed '>' (62): par.t1>pa.r>t2@example.com MailAddress failed '@' (64): par.t1@pa.r@t2@example.com MailAddress failed '[' (91): par.t1[pa.r[t2@example.com MailAddress failed '\' (92): par.t1\pa.r\t2@example.com MailAddress failed ']' (93): par.t1]pa.r]t2@example.com MailAddress failed '⌂' (127): par.t1⌂pa.r⌂t2@example.comAlso it doesn’t seem to support ‘quoted-string’ local-parts, like
'blah'@example.com.I don’t think a validator could accept any less before becoming unusable.