-
1. Re: CFmail errors- how to prevent error message from user?
Dan Bracuk Dec 20, 2011 12:06 PM (in response to sakonnetweb)In your cfmail tag, put a special email address in the FailTo attribute. Then see what mail that address gets after each mailing and update your db accordingly.
-
2. Re: CFmail errors- how to prevent error message from user?
ilssac Dec 20, 2011 1:27 PM (in response to sakonnetweb)As well as Dan's suggestion.
You can use the <cftry><cfctach> syntax to provide specific error handling to specific exceptions generated by specifc code.
I.E. you could wrap the <cfmail...> tag with a <cftry>...</cftry> block and then create a specific <cfcatch...> block that handles the bad email address exception any way you desire. As Dan sugested I would sugest somehow collecting the bad email address and providing them to somebody that can clean them from the data.
You could than also have a defalult <cfcatch...> block that would handle any other type of exception and|or rethrow the exception out to your current exception handler.
Some people don't like the concept of try|catch syntax, but I like it and feel it is a pretty elegant solution for this type of thing.
-
3. Re: CFmail errors- how to prevent error message from user?
sakonnetweb Dec 21, 2011 10:42 AM (in response to ilssac)OK thanks for all the help.
I think I left out a part. The user can't get into the system to delete- that needs to be done at my level.
When there's an addendum to send, the user sends out the attached file to all who have viewed the original Bid package. They would like to print the resulting page which shows the list of who the recepients were. When the error page comes up instead, they obviously can't print the list.
If the only way I can test for bad mail is to use FailTo, that test message would go out to 5000 vendor contacts- is there a way to show the resulting list even though some of the emails were bad?
IOW can code be used to ignore bad addresses and continue processing the rest?
Thanks again....
sakonnetweb
-
4. Re: CFmail errors- how to prevent error message from user?
Dan Bracuk Dec 21, 2011 2:35 PM (in response to sakonnetweb)I'm missing something here. If you have an email address in the correct format, you don't know if it's valid or not until you send mail to it. If it's valid, nothing happens. Otherwise, there is an Undeliverable mail reply.
On the ColdFusion side, all the cfmail tag does it generate a file and put it in the Spool folder.
So my question is, what is causing your error page to run?
-
5. Re: CFmail errors- how to prevent error message from user?
sakonnetweb Dec 22, 2011 11:38 AM (in response to Dan Bracuk)<cfset thisBidID = session.bid_ID> <cfquery name="list_sendto" datasource="#Request.BaseDSN#">
SELECT lc.contact_fname, lc.contact_lname, lc.contact_email, b.ReferenceNumber, b.Title, b.Description, jb.bid_ID, jv.vendor_ID FROM ((junction_bid_ccc jb LEFT JOIN junction_vendor_ccc jv ON jb.cccode_ID = jv.cccategory_ID) LEFT JOIN lookup_contact lc ON lc.vendor_new_ID = jv.vendor_ID) LEFT JOIN Bid b ON b.new_bid_ID = jb.bid_ID WHERE jb.bid_ID = #thisBidID# AND lc.contact_email <> '' AND lc.contact_email IS NOT NULL GROUP BY lc.vendor_new_ID, lc.contact_email, lc.contact_lname, lc.contact_fname, b.new_bid_ID, b.ReferenceNumber, b.Title,
b.Description, jb.bid_ID, jv.vendor_ID </cfquery>
<cfset thisReferenceNumber = list_sendto.ReferenceNumber>
<cfset thisTitle = list_sendto.Title>
<cfmail query="list_sendto" to="#contact_email#" from="whatever@whatever.com"
subject="Bid Notification" server="emailsrv1.cityofnewport.priv"
groupcasesensitive="no">
<p>You are receiving this message because .... etc.

