Mailer.cfc 1.0 and Email Logging

Instead of passing in multiple email settings, I use Mailer.cfc to send email from components.

I recently needed to keep track of every email sent by a client site (but not for the whole server). So, I added logging to Mailer.cfc.

Realizing that I had yet to make it a 1.0 release (an dI have been using Mailer since December 2004), this seemed like a good time.

I have already written an introduction to Mailer.cfc and I have done some presentations on Mailer.cfc, so I will cover the logging briefly here.

Like DataMgr, Mailer.cfc is part of the com.sebtools package (and like DataMgr it is no longer required that it be located there). It does not, however, require DataMgr or any other component. Unless, that is, you want to do logging of email sent by Mailer.cfc.

I chose to introduce the dependency on DataMgr for logging for the same basic reasons that I wrote DataMgr in the first place. It made adding the feature trivial to write (about 55 lines), but very flexible (records only the data available). It ensures that Mailer.cfc can work with any database supported by DataMgr (currently Access, MS SQL, MySQL, PostGreSQL - but adding more is easy and I plan to add support for more in the near future).

In order to have Mailer.cfc log the email that it sends, you need only call the startLogging() method. This method takes only one argument which is the DataMgr component that you want to use.

In order to stop Mailer.cfc from logging the email that it sends, call the stopLogging() method.

Feel free to download Mailer.cfc . It is free and open source.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.