|
From: David, the great David, the on 17 Jun 2008 04:04 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.
From: Evertjan. on 17 Jun 2008 04:41 =?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)
From: Mike Brind [MVP] on 17 Jun 2008 05:47 "Evertjan." <exjxw.hannivoort(a)interxnl.net> wrote in message news:Xns9AC06CC091EB4eejj99(a)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
From: Daniel Crichton on 17 Jun 2008 07:02 Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100: > "Evertjan." <exjxw.hannivoort(a)interxnl.net> wrote in message news:Xns9AC06CC091EB4eejj99(a)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
From: Mike Brind [MVP] on 17 Jun 2008 08:07
"Daniel Crichton" <msnews(a)worldofspack.com> wrote in message news:uUTgYmG0IHA.4040(a)TK2MSFTNGP04.phx.gbl... > Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100: > > >> "Evertjan." <exjxw.hannivoort(a)interxnl.net> wrote in message >> news:Xns9AC06CC091EB4eejj99(a)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 |