I know this is not exactly the kind of question welcome on SO, but I think it will be most useful if someone can share e-mail validation code snippet/function that fully complies with RFC rules.
Asked
Active
Viewed 1,043 times
1
-
The best way is to send an email. – Peter Wood Mar 14 '13 at 11:57
-
@PeterWood: That's not what I mean. I meant checking if the supplied string is a well-formed and valid e-mail address. If a user doesn't want to specify his e-mail so much that he enters a non-existing one - that's fine by me, but I want to tell him if he made a typo. – Violet Giraffe Mar 14 '13 at 11:58
-
See: [using a regular expression to validate an email address](http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address) – Peter Wood Mar 14 '13 at 11:59
-
2@PeterWood: I had. There's no solution there. Regex is _not_ a solution. – Violet Giraffe Mar 14 '13 at 12:00
-
See the top 3 answers to the linked question, particularly [this one](http://stackoverflow.com/a/532972/1084416). – Peter Wood Mar 14 '13 at 12:04
-
You're correct, `regex` is not a solution. The point is it's not easy, and you're unlikely to get a code snippet. The most likely snippet you will get will involve a `regex` and it will be wrong. I'm nipping the wrong answers in the bud. – Peter Wood Mar 14 '13 at 12:15
-
I don't know if this is the case but, in the event you can integrate your solution with a Microsoft .NET assembly (C++/CLI), I would suggest you to try our [EmailVerify.NET](http://cobisi.com/email-validation/.net-component), which offers complete RFC compliance for email addresses (RFC 1123, RFC 2821, RFC 2822, RFC 3490, RFC 3696, RFC 4291, RFC 5321, RFC 5322 and RFC 5336). – Efran Cobisi Mar 15 '13 at 11:53
-
@EfranCobisi: thanks, but I'm coding in plain C++ and don't have time for porting .Net implementation to C++. – Violet Giraffe Mar 15 '13 at 12:22