我正在尝试使用以下代码验证电子邮件地址列表:
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
当我输入“johndoe@amce”或“johndoe@acme, janedoe@acme.org”时,代码验证为真。输入不带扩展名的电子邮件地址(例如“.com”)是否实际上被视为有效的电子邮件地址?
谢谢,
垃圾