Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfmail error

Status
Not open for further replies.

PushCode

Programmer
Dec 17, 2003
573
US
I tried sending a message to a fairly large list of email addresses using cfmail. I got an error message b/c one of the email addresses had some improper characters in it. This was about half way through my list of email addresses. Should I assume that the email was sent to all email addresses before this one, and none after it?
 
Write a scrubber to check to make sure you emails are wellformed as well, it wont eliminate all the problems but it will help.. I had 1.4 million in one database, I scrubbed them for missing "@" and missing extentions, duplications etc and ended up tossing 40,000 emails that failed...
 
Good suggestion Brantguy, thanks to you as well.
 
My two cents would be to take ECAR's suggestion and wrap the code within <cftry><cfcatch>. For whatever reason the mailing fails in <cfcatch> email the error or log into the dB.

<cftry>
<cfloop query="get_email">
<cfif IsEmail(YourQueryValue)>
<cfmail>...</cfmail>
</cfif>
</cfloop>
<cfcatch type="any">
<!--- either lof the error or email the error. If emailing the error do a <cfdump> so you have all the info you need to help debug --->
</cfcatch>
<cftry>

Just don't assume the mailing failed cause of a invalid email syntax.

____________________________________
Just Imagine.
 
Gujum0del, can I do the cfdump like this?

<cfcatch type="any">
<cfmail To="me@me.com"
From="me@me.com"
Subject="Failed Mailing Attempt"
server="me.me.com">
<cfdump var="#cfcatch#">
</cfmail>
</cfcatch>
 
One thing though, I would do [color]type="html"[/color] so you see the table columns, rows and color style.

<cfcatch type="any">
<cfmail to="me" from="me" subject="Error" type="html">
<cfdump var="#cfcatch#" />
</cfmail>
</cfcatch>

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top