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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfmail checking 1

Status
Not open for further replies.

ice78991

Programmer
Nov 20, 2006
216
0
0
A page on my site is used to call cfmail and attach multiple attachments. I want to create an 'Email Sent Successfully' page. What is the best way to check the cfmail has processed and sent the email correctly. Would the answer be to put the cfmail in a try catch block?
 
You can't really verify if the e-mail was successfully received by the recipent. But what I alwayd do something like this to show the attempt was made:

Code:
<cftry>
  <cfmail to="" from="" subject="" type="">
  ...
  </cfmail>
  
  <!--- email sent show sucess page --->
  <cflocation url="sentemail.cfm?status=1">
<cfcatch type="any">
  <!--- catch any errors so you can properly debug.  I usually save the errors in the dB so I have a history, or you can e-mail the errors to an admin acct. --->

  <!--- email NOT sent show error page --->
  <cflocation url="sentemail.cfm?status=0">
</cfcatch>
</cftry>

_____________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top