473,668 Members | 2,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("C DO.Message")
objMessage.Subj ect = strSubject
objMessage.From = FromEmail
objMessage.To = ToEmail
objMessage.HTML Body = strBody

objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/configuration/smtpserver") = MAILSERVER

objMessage.Conf iguration.Field s.Item("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
objMessage.Conf iguration.Field s.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 3380
=?Utf-8?B?RGF2aWQsIHR oZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.publi c.inetserver.as p.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.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
=?Utf-8?B?RGF2aWQsIHR oZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.publi c.inetserver.as p.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.net wrote in message news:Xn******** ************@19 4.109.133.242.. .
>=?Utf-8?B?RGF2aWQsIHR oZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.publ ic.inetserver.a sp.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****@worldof spack.comwrote in message
news:uU******** ******@TK2MSFTN GP04.phx.gbl...
Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100:

>"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******* *************@1 94.109.133.242. ..
=?Utf-8?B?RGF2aWQsIHR oZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.publi c.inetserver.as p.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***@discussio ns.microsoft.co mwrote:
>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****@worldof spack.comwrote in message news:uU******** ******@TK2MSFTN GP04.phx.gbl...
>Mike wrote on Tue, 17 Jun 2008 10:47:21 +0100:
>>"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn****** **************@ 194.109.133.242 ...
=?Utf-8?B?RGF2aWQsIHR oZSBncmVhdA==?= wrote on 17 jun 2008 in
microsoft.pu blic.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
6477
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 $email = $_POST // Use John Coggeshalls script to validate the email address if(!eregi("^+(\.+)*@+(\.+)*(\.{2,3})$", $email) { echo "The e-mail was not valid";
21
3907
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 adresses and so on. I thought it might be a better way to programm an automated, dynamic form validation that works for all kinds of fields, shows the necessary error messages and highlights the coresponding form fields.
2
3402
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 the user to enter an email address. It seems to be ignoring the validation rule and just emailing the form anyway, can anyone help? Below is the the relevant code -
5
2597
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 validation on both. Is there a way to link the drop-down choice to the correspondent validation section while disabling validation for the other one? here's what I presently have:
3
2778
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 field is not filled out. However in Netscape NONE of the required field validations occurs at all in Netscape. The form is posting correctly because I can walk through the post back process. Any ideas why this is happening or how to fix it?
35
3349
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 this kind of routine. -- Thanks in advance! Mika
1
1813
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 the validation summary control. I want it to do client side validation so I set every validation control display property to none and set the validation summary control to ShowMessage to true and ShowSummary to false. Als form controls set...
7
2706
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 would be used for e-mail injection vulnerability) 2. Phone number (has to be in the format 555-5555) 3. Phone number area code (has to be limited to 3 characters) 4. Address has to be stripped of all illegal characters like slashes,
7
3602
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
6219
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 has to tell then them its wrong information but currently it takes then to a next page and then tells them its incorrect information. This is tedious as every time they enter wrong they will be redirected to a different page and then they have to...
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7405
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.