Lucee: How to programatically check if emails are stuck in the list of failed tasks

Viewed 357

About once a month, my Lucee app stops sending emails, and I get thousands of emails listed in the Administrator's Failed Task list. I can select them, click execute, and they are sent out but I want to do this programmatically so I can monitor for failed emails and then send them programmatically. Is there any way to do this? In Adobe ColdFusion, I used to just check for files in the bad email folder and mover then to the good email folder.

1 Answers

Too long for a comment... See this related question over on Lucee.org - Undeliverable Mail

Unfortunately Lucee does not offer the same functionality as Adobe ColdFusion for re-spooling failed emails. It only offers the function within the admin UI.

In the post I referenced above, ddspringle mentions that you can just simulate what the admin UI is doing in your own code. One of the benefits of open source software is that you can see the code. So he includes a link to the admin code that re-spools the email. The link is here - services.tasks.cfm lines 68-73

I will copy that code block here as well:

<cfadmin 
    action="executeSpoolerTask"
    type="#request.adminType#"
    password="#session["password"&request.adminType]#"
    id="#data.ids[idx]#">

And here is a link to the documentation for the cfadmin tag - cfadmin on cfdocs.org

CFADMIN ATTRIBUTE REFERENCE

  • action string Required - The administrative action to perform.
  • type string Required - The admin context: web or server.
  • password string Required - The admin password.

Hope that helps.

Related