cfboom.mail.models

Class EmailService

lucee.Component
    extended by cfboom.mail.models.EmailService

Class EmailService

Class Attributes:
  • singleton : true
  •  
  • output : false
  •  
  • displayname : Class EmailService
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Constructor Summary
    init(string debugEmail, string noReplyEmail, string server, numeric port, boolean useSSL, string username, string password)
    Method Summary
    string getEmailDomain(string email)
         Returns the email domain from an email.
    private any newMail()
         Helper function to create a new mail service with.
    void send(string to, string subject, [string body=''], [struct argumentStruct='[runtime expression]'], [string type='html'], [string toName=''], [string from='[runtime expression]'], [string fromName=''], [string htmlPath=''], [string textPath=''], [string cc=''], [string bcc=''])
         Construct and send an email the same every time.
    void sendDebugEmail([struct argumentStruct='[runtime expression]'], [string subject='Uncaught Error'], [string to='[runtime expression]'], [string type='html'], [string toName=''], [string from='[runtime expression]'], [string fromName=''], [string body=''], [string htmlPath='/cfboom/mail/includes/email/html/debug.cfm'], [string textPath=''], [string cc=''], [string bcc=''])
         Helper function to pass a debug struct in with optional subject to dump it out to the debug email recipient.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(string debugEmail, string noReplyEmail, string server, numeric port, boolean useSSL, string username, string password)

    Parameters:
    debugEmail
    noReplyEmail
    server
    port
    useSSL
    username
    password

    Method Detail

    getEmailDomain

    public string getEmailDomain(string email)

    Returns the email domain from an email. It does not do any validation on the email itself.

    Parameters:
    email
    Returns:
    the string after the "@" symbol in email.

    newMail

    private any newMail()

    Helper function to create a new mail service with the settings applied.


    send

    public void send(string to, string subject, [string body=''], [struct argumentStruct='[runtime expression]'], [string type='html'], [string toName=''], [string from='[runtime expression]'], [string fromName=''], [string htmlPath=''], [string textPath=''], [string cc=''], [string bcc=''])

    Construct and send an email the same every time.

    Parameters:
    to - This specifies to whom the email is to be sent.
    subject - This specifies the subject line of the email.
    body
    argumentStruct - This optional passes a struct of arguments found in the content file.
    type - This specifies the MIME type. 'html' means send html-only version, 'text' means send text-only version, 'html/text' means send both an html and a text version
    toName - This optionally specifies the recipient's name in the to header field.
    from - This optionally specifies who the email is from.
    fromName - This optionally specifies the recipient's name in the to header field.
    htmlPath - This optionally provides the path to the file that contains the html design. This should only be populated if html is one of the types of the email.
    textPath - This optionally provides the path to the file that contains the text content. This should only be populated if text is one of the types of the email.
    cc - This optionally provides a 'CC' for the email.
    bcc - This optionally provides a 'BCC' for the email.

    sendDebugEmail

    public void sendDebugEmail([struct argumentStruct='[runtime expression]'], [string subject='Uncaught Error'], [string to='[runtime expression]'], [string type='html'], [string toName=''], [string from='[runtime expression]'], [string fromName=''], [string body=''], [string htmlPath='/cfboom/mail/includes/email/html/debug.cfm'], [string textPath=''], [string cc=''], [string bcc=''])

    Helper function to pass a debug struct in with optional subject to dump it out to the debug email recipient.

    Parameters:
    argumentStruct - This optional passes a struct of arguments found in the content file.
    subject - This specifies the subject line of the email.
    to - This specifies to whom the email is to be sent.
    type - This specifies the MIME type. 'html' means send html-only version, 'text' means send text-only version, 'html/text' means send both an html and a text version
    toName - This optionally specifies the recipient's name in the to header field.
    from - This optionally specifies who the email is from.
    fromName - This optionally specifies the recipient's name in the to header field.
    body
    htmlPath - This optionally provides the path to the file that contains the html design. This should only be populated if html is one of the types of the email.
    textPath - This optionally provides the path to the file that contains the text content. This should only be populated if text is one of the types of the email.
    cc - This optionally provides a 'CC' for the email.
    bcc - This optionally provides a 'BCC' for the email.