I’m trying to validate a list of email addresses using the following code:
Public Function ValidateEmailAddressField() As Boolean
Dim isValid As Boolean = True
Try
txtServiceEmails.Text = txtServiceEmails.Text.Trim.Replace(",", ";")
Dim validateMailAddress = New MailAddress(txtServiceEmails.Text.Trim)
Return isValid
Catch ex As Exception
isValid = False
Return isValid
End Try
End Function
When I enter “johndoe@amce” or “johndoe@acme, janedoe@acme.org” the code validates true. Is entering an email address without an extension, such as “.com”, actually considered a valid email address?
Thanks,
crjunk
In an cooperation environment, a domain does not have to have .com/net/org… ‘acme’ could be a valid domain, so, the email me@acme could be a valid email address internally.
usually, people use regular expression to valid email address. there are lots of examples.