House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

How to validate email address before sending mail

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Yes use the following
Bryan F. Hogan
05/21/04 02:33 P
Good luck.
Bryan F. Hogan
05/21/04 02:56 P
At 12:26 PM 5/21/2004, you wrote:
Scott Weikert
05/21/04 02:34 P
Try this
Hassan Arteaga Rodriguez
05/21/04 02:37 P
Issac Rosa wrote:
Rick Root
05/21/04 03:10 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Issac Rosa
05/21/2004 02:28 PM

Does anyone know a good way to validate an email address prior to sending out the email?  The scenario is that I have a database of customers and want to send an email, but want to capture the email addresses that will bounce prior to sending the email. TIA, Issac

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan F. Hogan
05/21/2004 02:33 PM

Yes use the following <script> function checkForm(theForm)  { var emailRegex=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/; if(document.forms[theForm.name].contactEmail.value.length==0||emailRegex.test(document.forms[theForm.name].contactEmail.value)==false) { alert('Please enter the email address!'); return false; } else { return true; } } </script> <form name="myForm" action="..." method="post" onsubmit="return checkForm(this)"> ... </form> Issac Rosa wrote: > Does anyone know a good way to validate an email address prior to > sending out the email?  The scenario is that I have a database of > customers and want to send an email, but want to capture the email > addresses that will bounce prior to sending the email.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Issac Rosa
05/21/2004 02:43 PM

Thanks, I already do this prior to saving the email in the db.  I want to test the mailbox to make sure I get a valid response to avoid bounced messages prior to sending the actual email. Yes use the following <script> function checkForm(theForm) { var emailRegex=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/; if(document.forms[theForm.name].contactEmail.value.length==0||emailRegex .test(document.forms[theForm.name].contactEmail.value)==false) { alert('Please enter the email address!'); return false; } else { return true; } } </script> <form name="myForm" action="..." method="post" onsubmit="return checkForm(this)"> ... </form> Issac Rosa wrote: > Does anyone know a good way to validate an email address prior to > sending out the email?  The scenario is that I have a database of > customers and want to send an email, but want to capture the email > addresses that will bounce prior to sending the email.   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan F. Hogan
05/21/2004 02:56 PM

Good luck. Issac Rosa wrote: > Thanks, I already do this prior to saving the email in the db.  I want > to test the mailbox to make sure I get a valid response to avoid bounced > messages prior to sending the actual email.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Vernon
05/21/2004 03:00 PM

You can't guarantee that you will get the response you are expecting, for instance MS Exchange 2000 servers and below all respond 250 if the domain is valid and accept the mail, they may well bounce it later but if they manage that domain, they will accept anything sent to it initially. I know Exchange 2003 operates differently if you want it to in that it will only accept mail for the defined mailboxes if you set it up that way. As for other mail servers, I think how this is implemented is totally dependent on how the developers interpreted the relevant RFC documentation. Paul

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Scott Weikert
05/21/2004 02:34 PM

At 12:26 PM 5/21/2004, you wrote: >Does anyone know a good way to validate an email address prior to >sending out the email?  The scenario is that I have a database of >customers and want to send an email, but want to capture the email >addresses that will bounce prior to sending the email. I use a custom tag called ValidEmail (off the DevEx) that works pretty well. It's not 100% though.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Hassan Arteaga Rodriguez
05/21/2004 02:37 PM

Try this <cfif NOT REFindnocase("^[-_!a-z0-9\.]+@([-_a-z0-9]+\.)+[a-z]{2,6}$", form.email_Field)> Regards __ M.Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer DIGI-Grupo de Desarrollo COPEXTEL, S.A.   _____ Sent: Friday, May 21, 2004 1:26 PM To: CF-Talk Subject: How to validate email address before sending mail Does anyone know a good way to validate an email address prior to sending out the email?  The scenario is that I have a database of customers and want to send an email, but want to capture the email addresses that will bounce prior to sending the email. TIA, Issac   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
techmike
05/21/2004 02:38 PM

Do you want to validate just to make sure it fits the proper format for email, or to test if the domain and box exist? I know of no way to do the later, but you could use regular expressions to validate the format of the email. Do a google for email validation regex -mike ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Root
05/21/2004 03:10 PM

Issac Rosa wrote: > Does anyone know a good way to validate an email address prior to > sending out the email?  The scenario is that I have a database of > customers and want to send an email, but want to capture the email > addresses that will bounce prior to sending the email. It can't be done reliably.  MANY mail servers will accept mail for non-existent accounts, then bounce them.   - Rick


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference