Regular expression for validating email address in c

Rated 4.14/5 based on 812 customer reviews

Obviously there are expressions that you could use to determine if the format of an e-mail address is valid but you can also use the System.

Mail Address class to check if an exception occurs when creating the e-mail to determine if it is a valid or not : I suppose it depends on how you are currently sending it, but you might consider checking out this related Stack Overflow discussion along with this one which covers a few different techniques to try and check if your message was sent ().

Another important point to consider is that do you need to be performing this?

If the user is going to be entering an e-mail address in, it should be his or her responsibility to ensure that it was entered in correctly ( You can try one of these free email validation techniques - to track bounced emails, you can build a console app using an open source POP3 library like Indy.

Do you check for an at-sign, or is it more complicated?

I validate the email address at the client side by using the Regular Expression validator.

Regular expressions offer an extremely flexible and powerful way of adding validation to your website forms.

Combined with j Query, it allows you to ensure that data sent to the server matches all of your requirements.

Just an FYI: I'm the author of Mime Kit which has already been mentioned on this thread.

That said, I would not recommend the use of Mime Kit for simply validating an email address (it's way overkill).

Leave a Reply