Re: catching a query based cfmail ...
Hmmm... maybe the DAO type-deal, but that's a lot of work. The idea was to do it without looping the query first, so the isValid I don't think would work. The regex I mentioned was basically a way of putting some type of selection in the query itself, saying, "Grab me records with valid emails", which I presume the MySQL regex engine is capable of, dunno for sure, and no idea whatsoever about MSSQL and regex. Just spreading out the work load, CF shouldn't have to do it all! ;-) ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237849 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: catching a query based cfmail ...
And if you're on MX 7, you can use the isValid function with type="email". > -Original Message- > From: Jose Diaz [mailto:[EMAIL PROTECTED] > Sent: Friday, April 14, 2006 1:37 AM > > On cflib.org there is a function titled 'isEmail' I have used > this a few > times to validate emails. The function code is a s follows: > > > > function isEmail(str) { > return > (REFindNoCase("^['_a-z0-9-]+(\.['_a-z0-9-]+)[EMAIL PROTECTED](\.[a- > z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name|jobs|trav > el))$",arguments.str) > AND len(listGetAt(arguments.str, 1, "@")) LTE 64 AND > len(listGetAt(arguments.str, 2, "@")) LTE 255) IS 1; > } > > Another alternative if you are using sql server is to doa sql > function and wrap the email element in that for validation. > > Hope this helps > > On 4/14/06, Denny Valliant <[EMAIL PROTECTED]> wrote: > > > > A crazy option would be to use a regular expression > (available in MySQL) > > to > > grab only valid emails. > > > > Heh. With the regex stuff going on, had to mention it. > > > > By the by, a useful resource for regex for me has been > > www.regular-expressions.com. > > :D3|\|* > > > > On 4/13/06, Dawson, Michael <[EMAIL PROTECTED]> wrote: > > > > > > I think you are totally correct. You will need to do the > CFLOOP thing > > > to be able to catch an individual CFMAIL exception. > > > > > > M!ke > > > > > > -Original Message- > > > From: Rick Root [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, April 13, 2006 9:07 PM > > > > > > If I'm using cfmail with the query attribute, populating > the to address > > > dynamically... how to I catch an individual exception? > > > > > > Like if one row in the query contains an invalid email > address that > > > throws a cfmail exception. > > > > > > If i put try/catch around the whole cfmail tag set it'll > actually stop > > > the whole mailing... > > > > > > I'm assuming there's no way to do what I want to do > without axing the > > > query attribute and doing something like > > > > > > > > > > > > subject="foo"> > > > ... > > > > > > > > > > > > This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. A1. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237755 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: catching a query based cfmail ...
Hi Rick On cflib.org there is a function titled 'isEmail' I have used this a few times to validate emails. The function code is a s follows: function isEmail(str) { return (REFindNoCase("^['_a-z0-9-]+(\.['_a-z0-9-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name|jobs|travel))$",arguments.str) AND len(listGetAt(arguments.str, 1, "@")) LTE 64 AND len(listGetAt(arguments.str, 2, "@")) LTE 255) IS 1; } Another alternative if you are using sql server is to doa sql function and wrap the email element in that for validation. Hope this helps Jose Diaz On 4/14/06, Denny Valliant <[EMAIL PROTECTED]> wrote: > > A crazy option would be to use a regular expression (available in MySQL) > to > grab only valid emails. > > Heh. With the regex stuff going on, had to mention it. > > By the by, a useful resource for regex for me has been > www.regular-expressions.com. > :D3|\|* > > On 4/13/06, Dawson, Michael <[EMAIL PROTECTED]> wrote: > > > > I think you are totally correct. You will need to do the CFLOOP thing > > to be able to catch an individual CFMAIL exception. > > > > M!ke > > > > -Original Message- > > From: Rick Root [mailto:[EMAIL PROTECTED] > > Sent: Thursday, April 13, 2006 9:07 PM > > To: CF-Talk > > Subject: catching a query based cfmail ... > > > > If I'm using cfmail with the query attribute, populating the to address > > dynamically... how to I catch an individual exception? > > > > Like if one row in the query contains an invalid email address that > > throws a cfmail exception. > > > > If i put try/catch around the whole cfmail tag set it'll actually stop > > the whole mailing... > > > > I'm assuming there's no way to do what I want to do without axing the > > query attribute and doing something like > > > > > > > > > > ... > > > > > > > > > > > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237735 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: catching a query based cfmail ...
A crazy option would be to use a regular expression (available in MySQL) to grab only valid emails. Heh. With the regex stuff going on, had to mention it. By the by, a useful resource for regex for me has been www.regular-expressions.com. :D3|\|* On 4/13/06, Dawson, Michael <[EMAIL PROTECTED]> wrote: > > I think you are totally correct. You will need to do the CFLOOP thing > to be able to catch an individual CFMAIL exception. > > M!ke > > -Original Message- > From: Rick Root [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 13, 2006 9:07 PM > To: CF-Talk > Subject: catching a query based cfmail ... > > If I'm using cfmail with the query attribute, populating the to address > dynamically... how to I catch an individual exception? > > Like if one row in the query contains an invalid email address that > throws a cfmail exception. > > If i put try/catch around the whole cfmail tag set it'll actually stop > the whole mailing... > > I'm assuming there's no way to do what I want to do without axing the > query attribute and doing something like > > > > > ... > > > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237731 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: catching a query based cfmail ...
I think you are totally correct. You will need to do the CFLOOP thing to be able to catch an individual CFMAIL exception. M!ke -Original Message- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Thursday, April 13, 2006 9:07 PM To: CF-Talk Subject: catching a query based cfmail ... If I'm using cfmail with the query attribute, populating the to address dynamically... how to I catch an individual exception? Like if one row in the query contains an invalid email address that throws a cfmail exception. If i put try/catch around the whole cfmail tag set it'll actually stop the whole mailing... I'm assuming there's no way to do what I want to do without axing the query attribute and doing something like ... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237726 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
catching a query based cfmail ...
If I'm using cfmail with the query attribute, populating the to address dynamically... how to I catch an individual exception? Like if one row in the query contains an invalid email address that throws a cfmail exception. If i put try/catch around the whole cfmail tag set it'll actually stop the whole mailing... I'm assuming there's no way to do what I want to do without axing the query attribute and doing something like ... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237724 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54