Link to home
Start Free TrialLog in
Avatar of HalCHub
HalCHubFlag for United States of America

asked on

vba/vb check if email address is send-able to

I am in need of some vb or vba code which would allow me to determine if an email address exists on the stated email domain.
I know how to validate the format of an address.
Avatar of ThomasMcA2
ThomasMcA2

That's not possible, and I'm glad that it's not possible. Imagine the amount of SPAM you would get if a sender could test every possible email address until they found valid ones!
Avatar of HalCHub

ASKER

I know you are wrong because I do it in PHP
If you're doing this, then shed more light on "how" in PHP.  Not the code, but the concept.  

If you're talking about your own email domain, then sure you can.  However, if you're talking about any random email address at a domain you don't own, no you cant.  

You CAN send an email to an address and see if you get a bounce back, but that does not appear to be what you are asking.
Avatar of IrogSinta
I would have to disagree with the others here.  I know it can be done because I had one of my guys work on this same issue at our workplace.  You would have to download an API to be able to do this though and there is a fee if you want to do more than a certain amount of emails in a period of time.  Sorry that I can't give you the specifics on what he ended up using.  I just know that it could be done.  I believe it has something to do with querying a DNS MX record and then performing a "RCPT TO" command to test if this SMTP server accepts the email address.

Ron
Ron, that is soooo very close to being essentially the same as sending a message and testing for a bounce.
Ray, maybe it is. Honestly, I'm not certain how these companies that do these real-time bulk email validations do it.  Here's a link below for one company that I'm not affiliated with that gives you an API and allows you to validate up to 1000 addresses each month for free.  If you need to validate a larger number, obviously there's a fee.
https://mailboxlayer.com/

Ron
Thanks for the Pointer Ron.
I emailed that company so I could learn something about what is really being done and here is the response I received . . . Unless Excel VBA can do smtp commands (not just send mail), I think the net answer is still "no" to the asked question.

Essentially, the mailboxlayer API verifies email addresses using SMTP (Simple Mail Transfer Protocol), which is the protocol we all use in order to send and receive emails. Very similar to pinging a URL to verify the existence of a web server, our API makes use of mail servers' SMTP conversations in order to determine whether or not a individual email address is actually allotted to a user.

Example: The API's "SMTP Check" will return "true" when validating your email address "xxxxxx@gmail.com". However, if you request validation of a wrong email address like "xxxxxxY@gmail.com", the validation result will be negative.

The clear advantage of this method of validation is that no actual emails have to be sent. A "bounce test" would very quickly result in our email validation servers being blacklisted due to spam regulations.

Please be aware that it is not possible to determine whether or not an email address is actually being used by the person who created it. However, when using our API to - for instance - validate the existence of an email address entered by a user during a registration process, it's valuable to know if that address can actually receive email, or not. Based on this knowledge you can make more informed decisions about email campaigns, registration restrictions, etc.
Unless Excel VBA can do smtp commands (not just send mail), I think the net answer is still "no" to the asked question.
Ray, good job for emailing the company but in regards to the SMTP commands you mentioned, if they give you an API to download, this can be added as a Reference in your .Net project or your Excel VBA code references so I don't see any problem there.  Now if the question was whether it could be done natively without addons or additional libraries, then you're right; however, I don't see that in the question nor does it makes sense that someone working in .Net or VBA would limit themselves in this manner.

Ron
Avatar of HalCHub

ASKER

I've requested that this question be deleted for the following reason:

no one is answering the question they are going round and round with a discussion
ASKER CERTIFIED SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial