Groups | Blog | Home
all groups > dotnet security > october 2004 >

dotnet security : Valid email addresses


Shabam
10/8/2004 6:32:47 AM
I have a form that takes in a series of comma-delisted email addresses. The
system needs to check that each mail is a valid mail, and that only certain
letters are allowed. These emails are then stored in a database, where the
system sends mails out to. Each user has a limit as to how many emails he
can input into this form, to prevent spam.

What is the best way to validate an email? I don't need to validate that it
actually exists, or that the domain is live.

Also, what characters should I allow? I don't want users to circumvent my
controls by using characters like ";" or others to spoof the content, like
how some spammers are abusing some of those cgi form mail scripts.

Andreas Håkansson
10/8/2004 4:59:13 PM
Shabam,

Regular Expressions is your friend. Look them up in the documentation and/or
msdn. For example on what kinds of regular expressions you can use to
validate
an e-mail have a look at http://www.regxlib.com/DisplayPatterns.aspx and
choose
the pattern which satisfies your needs.

HTH,

//Andreas

"Shabam" <blislecp@hotmail.com> skrev i meddelandet
news:OOWdnRozDdThC_vcRVn-pg@adelphia.com...
[quoted text, click to view]

AddThis Social Bookmark Button