It’s a common question : “How can I validate one email address” ?
There are 0b10 (2) types of developers : lazy and ignorant.
- Lazy people always wins, because they do not reinventing the wheel, they prefer to search already done API.
- Ignorant people will probably use Regexp (I love regexp but not in this case) or write a new algorithm, they could spend few hours or days to implement the full RFC, good luck !
So the code is obvisouly server side, and in .net :
try { new HttpRequestMessage().Headers.From = "mail@foo.com"; //here the mail is valid } catch(FormatException ex) { // here the email is invalid }