473,382 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Validation on email address

Hi,
Is there a way to validate an email address and to check whether it is
sendable?
Function EmailTo(ToEmail, FromEmail, strSubject, strBody)

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = strSubject
objMessage.From = FromEmail
objMessage.To = ToEmail
objMessage.HTMLBody = strBody

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MAILSERVER

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
If objMessage.Send Then
EmailTo = 1
Else
EmailTo = 0
End If

Set objMessage = nothing
End Function

The code shown as above, even if the mail is not successfully send, it still
return the value 1.
Jun 27 '08 #1
6 3358
=?Utf-8?B?RGF2aWQsIHRoZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.public.inetserver.asp.general:
Is there a way to validate an email address
While you can check if the address has a @ in it and some letters before
the @ and letters period letters after the @, you will experience that any
more elaborate scheme will usually get some of your correspondents into
unforeseen trouble.
and to check whether it is sendable?
The proof of the pudding is in the eating,
trial and error sending is the only real valid option,
I think.

[Some?] serverside email programmes,
I happily use Jmail and have no experience with others,
return a boolean false if the sending aborts.

Final testing without sending if the email adress string is valid,
seems impossible.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 27 '08 #2

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
=?Utf-8?B?RGF2aWQsIHRoZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.public.inetserver.asp.general:
>Is there a way to validate an email address

While you can check if the address has a @ in it and some letters before
the @ and letters period letters after the @, you will experience that any
more elaborate scheme will usually get some of your correspondents into
unforeseen trouble.
>and to check whether it is sendable?

The proof of the pudding is in the eating,
trial and error sending is the only real valid option,
I think.

[Some?] serverside email programmes,
I happily use Jmail and have no experience with others,
return a boolean false if the sending aborts.

Final testing without sending if the email adress string is valid,
seems impossible.
There are 3rd party components that will validate email addresses, but I
can't vouch for how good any of them are. A trial version of an Hexillion
component helped me clean a list up once, but wasn't foolproof.

--
Mike Brind
Microsoft MVP - ASP/ASP.NET
Jun 27 '08 #3
Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100:

"Evertjan." <ex**************@interxnl.netwrote in message news:Xn********************@194.109.133.242...
>=?Utf-8?B?RGF2aWQsIHRoZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.public.inetserver.asp.general:
>>Is there a way to validate an email address
>While you can check if the address has a @ in it and some letters
before the @ and letters period letters after the @, you will
experience that any more elaborate scheme will usually get some of
your correspondents into unforeseen trouble.
>>and to check whether it is sendable?
>The proof of the pudding is in the eating, trial and error sending is
the only real valid option,
I think.
>[Some?] serverside email programmes,
I happily use Jmail and have no experience with others, return a
boolean false if the sending aborts.
>Final testing without sending if the email adress string is valid,
seems impossible.
There are 3rd party components that will validate email addresses, but
I can't vouch for how good any of them are. A trial version of an
Hexillion component helped me clean a list up once, but wasn't
foolproof.
If it relies on using the VRFY command in SMTP, or goes through the motions
of sending but sending a QUIT after the SMTP response that says the RCPT TO
clause it accetped, then it'll only work in specific circumstances. VRFY is
often disabled as it's an open invitation for spammers to just repeatedly
try random strings until they find valid addresses, and the other method
only works if you happen to be sending direct to the receipient SMTP server
and it is able to verify that the account exists and doesn't have a blanket
setting to just accept all email and discard those that are for non-existent
accounts. Often the web server is unable to contact the end recipient server
directly and so these methods will fail before even getting to the first
stage.

--
Dan
Jun 27 '08 #4

"Daniel Crichton" <ms****@worldofspack.comwrote in message
news:uU**************@TK2MSFTNGP04.phx.gbl...
Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100:

>"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
=?Utf-8?B?RGF2aWQsIHRoZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.public.inetserver.asp.general:
>Is there a way to validate an email address
While you can check if the address has a @ in it and some letters
before the @ and letters period letters after the @, you will
experience that any more elaborate scheme will usually get some of
your correspondents into unforeseen trouble.
>and to check whether it is sendable?
The proof of the pudding is in the eating, trial and error sending is
the only real valid option,
I think.
[Some?] serverside email programmes,
I happily use Jmail and have no experience with others, return a
boolean false if the sending aborts.
Final testing without sending if the email adress string is valid,
seems impossible.
>There are 3rd party components that will validate email addresses, but
I can't vouch for how good any of them are. A trial version of an
Hexillion component helped me clean a list up once, but wasn't
foolproof.

If it relies on using the VRFY command in SMTP, or goes through the
motions of sending but sending a QUIT after the SMTP response that says
the RCPT TO clause it accetped, then it'll only work in specific
circumstances. VRFY is often disabled as it's an open invitation for
spammers to just repeatedly try random strings until they find valid
addresses, and the other method only works if you happen to be sending
direct to the receipient SMTP server and it is able to verify that the
account exists and doesn't have a blanket setting to just accept all email
and discard those that are for non-existent accounts. Often the web server
is unable to contact the end recipient server directly and so these
methods will fail before even getting to the first stage.
Which all goes to support Evertjan's reply - send the email. Get them to
click a link in it that validates the fact that they received it. We
shouldn't really be sending email to people unless they have asked for it in
the first place...

--
Mike Brind
Microsoft MVP - ASP/ASP.NET
Jun 27 '08 #5
David, the great <David, the gr***@discussions.microsoft.comwrote:
>Hi,
Is there a way to validate an email address and to check whether it is
sendable?
Not really. You can check for proper syntax, but remember that there
are a variety of acceptable syntaxes for email addresses. Once you're
sure the syntax is right, does the domain name actually have a mail
server? And if there's a server, is the user name (left of the @ sign)
a legitimate user on that server? The only way to be 100% sure is to
send it. Of course, if the user is bogus the mail server may just
swallow the message and send no bounce message. Then you're no wiser
than you were before.

--
Tim Slattery
MS MVP(Shell/User)
Sl********@bls.gov
http://members.cox.net/slatteryt
Jun 27 '08 #6
Mike wrote on Tue, 17 Jun 2008 13:07:35 +0100:

"Daniel Crichton" <ms****@worldofspack.comwrote in message news:uU**************@TK2MSFTNGP04.phx.gbl...
>Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100:
>>"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
=?Utf-8?B?RGF2aWQsIHRoZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.public.inetserver.asp.general:
>>>>Is there a way to validate an email address
>>>While you can check if the address has a @ in it and some letters
before the @ and letters period letters after the @, you will
experience that any more elaborate scheme will usually get some of
your correspondents into unforeseen trouble.
>>>>and to check whether it is sendable?
>>>The proof of the pudding is in the eating, trial and error sending
is the only real valid option,
I think.
>>>[Some?] serverside email programmes,
I happily use Jmail and have no experience with others, return a
boolean false if the sending aborts.
>>>Final testing without sending if the email adress string is valid,
seems impossible.
>>There are 3rd party components that will validate email addresses,
but
I can't vouch for how good any of them are. A trial version of an
Hexillion component helped me clean a list up once, but wasn't
foolproof.
>If it relies on using the VRFY command in SMTP, or goes through the
motions of sending but sending a QUIT after the SMTP response that
says the RCPT TO clause it accetped, then it'll only work in
specific circumstances. VRFY is often disabled as it's an open
invitation for spammers to just repeatedly try random strings until
they find valid addresses, and the other method only works if you
happen to be sending direct to the receipient SMTP server and it is
able to verify that the account exists and doesn't have a blanket
setting to just accept all email and discard those that are for
non-existent accounts. Often the web server is unable to contact the
end recipient server directly and so these methods will fail before
even getting to the first stage.
Which all goes to support Evertjan's reply - send the email. Get them
to click a link in it that validates the fact that they received it. We
shouldn't really be sending email to people unless they have asked
for it in the first place...
I can't agree more with that reply :)

--
Dan
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Dynamo | last post by:
Hi The following script was taken from John Coggeshall's (PHP consultant) in his article on Zends site at http://www.zend.com/zend/spotlight/ev12apr.php // Get the email address to validate...
21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
2
by: Andrew | last post by:
I've ripped off some script from another site of mine that works fine which checks an input box to see if an email address has been entered when submitting. If it hasn't a prompt is issued asking...
5
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce...
3
by: Rick | last post by:
I have an interesting problem when I run the following code in Netscape (7.02) vs. IE. This page works great in IE and all my controls bring up the validation summary dialog box if the required...
35
by: Mika M | last post by:
Simple question: Does Framework (1.1) contain any routine to check entered email-address is valid ? It's quite easy to make own code for that purpose, but why to do if Framework (1.1) contain...
1
by: Buddy Ackerman | last post by:
I don't know what the problem is. I have a form with several controls that need to be validated, I put a validation group in every form control, every validatoino control, the submit button and...
7
by: lepage.diane | last post by:
Hello I am a newbie to PHP. Please bear with me. I need to validate the following fields using php. 1. email (needs to be just one e-mail address, and take out stuff like bcc or anything that...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
3
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.