Validating e-mail address
Dim objMsg ' We manually create Message object here. In your code, ' you can also reuse any existing Message object, such ' as SMTP.Message Set objMsg = CreateObject("MailBee.Message") ' Check email address for syntax only. Because ' "mailbox@non-existent-domain.com" email is ' syntactically correct, the method will return True If objmsg.ValidateEmailAddress("mailbox@non-existent-domain.com") Then MsgBox "E-mail address syntax is correct" Else MsgBox "Syntax check failed" End If ' Check email address for syntax and for domain existence. ' If "non-existent-domain.com" host does not exist, the method ' will return False If objmsg.ValidateEmailAddress("mailbox@non-existent-domain.com", 1) Then MsgBox "E-mail address is probably correct" Else MsgBox "E-mail address is incorrect" End If
<% Dim objMsg ' We manually create Message object here. In your code, ' you can also reuse any existing Message object, such ' as SMTP.Message Set objMsg = Server.CreateObject("MailBee.Message") ' Check email address for syntax only. Because ' "mailbox@non-existent-domain.com" email is ' syntactically correct, the method will return True If objmsg.ValidateEmailAddress("mailbox@non-existent-domain.com") Then Response.Write "E-mail address syntax is correct <br>" Else Response.Write "Syntax check failed <br>" End If ' Check email address for syntax and for domain existence. ' If "non-existent-domain.com" host does not exist, the method ' will return False If objmsg.ValidateEmailAddress("mailbox@non-existent-domain.com", 1) Then Response.Write "E-mail address is probably correct" Else Response.Write "E-mail address is incorrect" End If %>See Also: