Recently, I updated some code to use System.Net.Mail.MailAddress() to check if an e-mail address is valid or not. Shortly after, I noticed some email addresses with commas in the domain name are considered valid, for example, the code below will indicate the email address is Valid???
Good grief! -- how are the rest of you handling this??
dim ok as Boolean
dim test_str as String = "someone@comma,com"
dim email as System.Net.Mail.MailAddress
ok = true
Try
email = new System.Net.Mail.MailAddress( test_str )
Catch ex As Exception
ok = false
End Try
if ( ok ) then
response.write( "Valid" )
else
response.write( "INVALID" )
end if