• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Check the validity of email

Good evening.

I have a list of emails and I would like to understand which of them are valid and which are not.

There are programs that allow you to do this type of verification and I thought I'd ask if it is also possible to do it with VBA.

Thanks
 
I probably expressed myself badly. I was not referring to the synthase but to the existence of the email. I know that online systems and software send an stmp request (I am not if I wrote it correctly) and from this request it emerges if the email exists.
 
I would like to understand if it is also possible to do it with a macro but I have not found anything on google and in the forums. Maybe it's not possible
 

Logit

Active Member
This resource has an excellent discussion of the issue and apparently a VBA solution ... IF ... you want to pay for it :
https://www.experts-exchange.com/questions/28745322/vba-vb-check-if-email-address-is-send-able-to.html?redirect=/questions/28745322/vba-vb-check-if-email-address-is-send-able-to.html&offering=3032&anchor=succeeded#succeeded

This resource provides free email address checking up to 1,000 per month ? :
https://mailboxlayer.com/

This appears to be what you are seeking :
https://www.emailarchitect.net/easendmail/kb/vb.aspx
 

Logit

Active Member
Code:
Const ConnectNormal = 0
Const ConnectSSLAuto = 1
Const ConnectSTARTTLS = 2
Const ConnectDirectSSL = 3
Const ConnectTryTLS = 4

Sub EmailAddrTest()

    Dim oSmtp As New EASendMailObjLib.Mail
    Dim ConnectTryTLS
    oSmtp.LicenseCode = "TryIt"

    ' Set your sender email address
    oSmtp.FromAddr = "youremail@yahoo.com"
    ' Add recipient email address
    oSmtp.AddRecipientEx "emailaddressbeingtested@gmail.com", 0

    ' Set email subject
    oSmtp.Subject = "simple email from VB 6.0 project"
    ' Set email body
    oSmtp.BodyText = "this is a test email sent from VB 6.0 project, do not reply"

    ' Your SMTP server address
    oSmtp.ServerAddr = "smtp.yahoo.com"

    ' User and password for ESMTP authentication, if your server doesn't require
    ' User authentication, please remove the following codes.
    oSmtp.UserName = "yours@yahoo.com"
    oSmtp.Password = "your password here"

    ' ConnectTryTLS means if server supports SSL/TLS connection, SSL/TLS is used automatically
    oSmtp.ConnectType = ConnectTryTLS

    ' If your server uses 587 port
    ' oSmtp.ServerPort = 587

    ' If your server uses 25/587/465 port with SSL/TLS
    ' oSmtp.ConnectType = ConnectSSLAuto
    ' oSmtp.ServerPort = 25 ' 25 or 587 or 465

    MsgBox "start to send email ..."
    If oSmtp.SendMail() = 0 Then
        MsgBox "email was sent successfully!"
    Else
        MsgBox "failed to send email with the following error:" & oSmtp.GetLastErrDescription()
    End If

End Sub
Be certain to download and install the reference file : EASendMailObjLib.Mail discussed in the link provided.
 
Last edited:
Hi Logit.

I entered the code and selected the reference to objects after installing it on the pc.

When I start the macro, a sending message comes out, but then it stops and the message you see attached appears.
72940
Basically you can also use the visual basic code. I thought not ...
 

Logit

Active Member
You will need to make certain the correct email and password are used in the macro code.
It might take some "playing with" to get it correct. I had to check the internet for my
YAHOO email to be certain I was using the correct SERVER PORT number and SMTP
mail address.

It did work successfully here checking my personal email address.
 
Top