coldfusion - Deleting email addresses where email wasn't sent -


i can't see way this, i'm hoping there clever hack make work.

we have send out regular emails customers, many of who's emails expire , give mail delivery failure. keep database accurate , clean, i'd delete record database when email fails sent them.

so goes little this:

<cfloop query="rscustomers"> <cftry>  <cfmail to="rscustomers.email" from="us@ourcompany.com" failto="fails@ourcompany.com" subject="whatever"> [email text here] </cfmail>  <cfcatch type="any"> <!--- skip record when fails send ---> </cfcatch> </cftry>  </cfloop> 

i run query within catch area delete records when there error in record (e.g. malformed email address). nothing happens when mail undeliverable. failure notice inbox these can in hundreds difficult manually go through , delete database.

is there anyway "catch" failed send emails , feed them in query delete database?

someone once did presentation on @ function attended. approach was:

  • when sending mail, use special email address in failto attribute.
  • write .cfm file uses cfpop tag read mail sent address. (this may have been before cfexchange tag available)
  • add code reads delivery failure notfications , extracts email addresses.
  • do addresses

the presenter ran file scheduled job.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -