Rank: Newbie
Groups: Registered
Joined: 4/13/2020(UTC)
Posts: 0
Location: Rhode Island
Here is my function: Public Function Verify_EmailAddress ( strEmailAddress As String ) As String Dim strReturn As String = "" Try Dim oMail As New EASendMail.SmtpMail ( "TryIt" ) Dim oServer As New EASendMail.SmtpServer ("" ) ' Do not set SMTP server address Dim oSmtp As New EASendMail.SmtpClient () oSmtp.LogFileName = "C:\smtp.txt" Dim mFrom As EASendMail.MailAddress = New EASendMail.MailAddress ( "PaulGScannell@gmail.com", "Jerry" ) 'Dim mTo As EASendMail.MailAddressCollection = New EASendMail.MailAddressCollection ( strEmailAddress, "TestValidation" ) oMail.From = mFrom oMail.To = strEmailAddress oSmtp.TestRecipients(oServer, oMail) Catch ep As Exception strReturn = ep.Message End Try Return strReturn End Function
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
How does it work? Firstly, SmtpClient performs a DNS MX record query. If it retrieves the recipient's local SMTP server successfully, SmtpClient will try to connect to this server. SmtpClient then performs "RCPT TO" command to test if this SMTP server accepts this email address. Why we don't recommend testing email address? Because it totally depends on your networking connection, if your networking connection to the recipient server is bad or your IP address is blocked by the recipient server, test will be failed, but it doesn't mean this email address is invalid. Moreover, to prevent email address testing, many email providers accept the recipient address at first no matter if the address is valid or invalid, only after you sent the email data to the server, then the server rejects it if the recipient address is invalid. Recommended Solution Send the email to the recipient without testing. If you don't get Transport Error and Failure Report in 24 hours, that means the recipient is valid. If you get Failure Report, you should consider to remove this recipient from your mail listing. Please do not use SmtpServer("") to send email, because if you don't have a static IP address and set correct SPF record, almost email providers would reject your message due to anti-spam policy.
Forum Jump
EmailArchitect Support
Email Component Development
- EASendMail SMTP Component - .NET Version
- EASendMail SMTP Component - Windows Store Apps
- EASendMail SMTP ActiveX Object
- EAGetMail POP3 & IMAP4 Component - .NET Version
- EAGetMail POP3 & IMAP4 ActiveX Object
Exchange Server and IIS SMTP Plugin
- DomanKeys/DKIM for Exchange Server and IIS SMTP
- Disclaimer and S/MIME for Exchange Server and IIS
EmailArchitect Email Server
- EmailArchitect Email Server (General)
- EmailArchitect Email Server Development
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.