com.sebtools.Mailer
Component Mailer (Mailer)


I handle sending of email notices. The advantage of using Mailer instead of cfmail is that I can be instantiated with information and then passed as an object to a component that sends email, circumventing the need to pass a bunch of email-related information to each component that sends email.


hierarchy: WEB-INF.cftags.component
      com.sebtools.Mailer
properties:
methods: addNotice, getData, getDataKeys,getFrom, getNotices, init, removeNotice, send, sendNotice, startLogging, stopLogging
* - private method

addNotice
public void addNotice ( required string name, required string Subject, string Contents, string To="", string From="", string datakeys="", string type="text", string CC="", string BCC="", string ReplyTo="", string Attachments="", string html="", string text="", string username="", string password="", string FailTo="", string mailerID="ColdFusion MX Application Server", string wraptext="800" )

I add a notice to the mailer.

Output: supressed
Parameters:
   name: string, required, name
   Subject: string, required, Subject
   Contents: string, optional, Contents
   To: string, optional, To
   From: string, optional, From
   datakeys: string, optional, datakeys
   type: string, optional, type
   CC: string, optional, CC
   BCC: string, optional, BCC
   ReplyTo: string, optional, ReplyTo
   Attachments: string, optional, Attachments
   html: string, optional, html
   text: string, optional, text
   username: string, optional, username
   password: string, optional, password
   FailTo: string, optional, FailTo
   mailerID: string, optional, mailerID
   wraptext: string, optional, wraptext

getData
public struct getData ( )

I get the data stored in the Mailer component.

Output: supressed

getDataKeys
public string getDataKeys ( required string name )

I get the datakeys for the given email notice. The datakeys are the items that can/should be overridden by incoming data.

Output: supressed
Parameters:
   name: string, required, name

getFrom
public string getFrom ( )

Output: supressed

getNotices
public struct getNotices ( )

Output: supressed

init
public Mailer init ( required string MailServer, required string From, string To="", string username="", string password="", struct RootData="[runtime expression]" )

I instantiate and return this object.

Output: supressed
Parameters:
   MailServer: string, required, MailServer
   From: string, required, From
   To: string, optional, To
   username: string, optional, username
   password: string, optional, password
   RootData: struct, optional, RootData

removeNotice
public void removeNotice ( required string name )

I remove a notice from the mailer.

Output: supressed
Parameters:
   name: string, required, name

send
public boolean send ( required string To, required string Subject, string Contents, string From="[runtime expression]", string CC="", string BCC="", string type="text", string ReplyTo="", string Attachments="", string html="", string text="", string username="[runtime expression]", string password="[runtime expression]", string FailTo="", string mailerID="ColdFusion MX Application Server", string wraptext="800" )

I send an email message and indicate if the send was successful.

Output: supressed
Parameters:
   To: string, required, To
   Subject: string, required, Subject
   Contents: string, optional, Contents
   From: string, optional, From
   CC: string, optional, CC
   BCC: string, optional, BCC
   type: string, optional, type
   ReplyTo: string, optional, ReplyTo
   Attachments: string, optional, Attachments
   html: string, optional, html
   text: string, optional, text
   username: string, optional, username
   password: string, optional, password
   FailTo: string, optional, FailTo
   mailerID: string, optional, mailerID
   wraptext: string, optional, wraptext

sendNotice
public struct sendNotice ( required string name, struct data )

I send set/override any data based on the data given and send the given notice.

Output: supressed
Parameters:
   name: string, required, name
   data: struct, optional, data

startLogging
public void startLogging ( required any DataMgr )

I make sure that all email sent from Mailer is logged in the mailerLogs table of the datasource managed by the given DataMgr.

Output: supressed
Parameters:
   DataMgr: any, required, DataMgr

stopLogging
public void stopLogging ( )

I stop the logging of email sent from Mailer.

Output: supressed