Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Validation on email address

Reply
Thread Tools

Validation on email address

 
 
David, the great
Guest
Posts: n/a
 
      06-17-2008
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.


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      06-17-2008
=?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)
 
Reply With Quote
 
 
 
 
Mike Brind [MVP]
Guest
Posts: n/a
 
      06-17-2008

"Evertjan." <(E-Mail Removed)> wrote in message
news:Xns9AC06CC091EB4eejj99@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


 
Reply With Quote
 
Daniel Crichton
Guest
Posts: n/a
 
      06-17-2008
Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100:


> "Evertjan." <(E-Mail Removed)> wrote in message news:Xns9AC06CC091EB4eejj99@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


 
Reply With Quote
 
Mike Brind [MVP]
Guest
Posts: n/a
 
      06-17-2008

"Daniel Crichton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100:
>
>
>> "Evertjan." <(E-Mail Removed)> wrote in message
>> news:Xns9AC06CC091EB4eejj99@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


 
Reply With Quote
 
Tim Slattery
Guest
Posts: n/a
 
      06-17-2008
David, the great <David, the http://www.velocityreviews.com/forums/(E-Mail Removed)> wrote:

>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)
(E-Mail Removed)
http://members.cox.net/slatteryt
 
Reply With Quote
 
Daniel Crichton
Guest
Posts: n/a
 
      06-18-2008
Mike wrote on Tue, 17 Jun 2008 13:07:35 +0100:


> "Daniel Crichton" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>> Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100:



>>> "Evertjan." <(E-Mail Removed)> wrote in message
>>> news:Xns9AC06CC091EB4eejj99@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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Non-English Validation Expression for email address? Mark B ASP .Net 3 07-22-2009 12:34 PM
regarding validation of email address. Vamsi Krishna Ruby 2 07-28-2008 05:12 PM
email address validation wizard04 Javascript 5 06-27-2007 02:42 PM
My own email address as a SIP address? UK VOIP 24 01-10-2006 07:22 PM
Email Address Validation Bob Perl Misc 10 06-23-2005 08:17 AM



Advertisments