send()

Overview

public any function send(
      string  template              = ""
    , string  recipientId           = ""
    , struct  args                 
    , array   to                   
    , string  from                  = ""
    , string  subject               = ""
    , array   cc                   
    , array   bcc                  
    , array   replyTo              
    , array   failTo               
    , string  htmlBody              = ""
    , string  textBody              = ""
    , struct  params               
    , string  resendOf              = ""
    , boolean returnLogId           = false
    , boolean overwriteTemplateArgs = false
    , boolean isTest                = false
)

Sends an email. If a template is supplied, first runs the template handler which can return a struct that will override any arguments passed directly to the function

Arguments

NameTypeRequiredDescription
templatestringNo (default="")Name of the template whose handler will do the rendering, etc.
recipientIdstringNo (default="")ID of the recipient of the email (for new as of 10.8.0 templated emails only)
argsstructNoStructure of arbitrary arguments to forward on to the template handler
toarrayNoArray of email addresses to send the email to
fromstringNo (default="")Optional from email address
subjectstringNo (default="")Optional email subject. If not supplied, the template handler should supply it
ccarrayNoOptional array of CC addresses
bccarrayNoOptional array of BCC addresses
replyToarrayNoOptional array of email addresses that replies should go to
failToarrayNoOptional array of email addresses that failure notifications should go to
htmlBodystringNo (default="")Optional HTML body
textBodystringNo (default="")Optional plain text body
paramsstructNoOptional struct of cfmail params (headers, attachments, etc.)
resendOfstringNo (default="")Optional ID of the message log item that is being resent
returnLogIdbooleanNo (default=false)Should the method return the ID of the sent message instead of a boolean success value
overwriteTemplateArgsbooleanNo (default=false)If true, then any arguments passed to this function will overwrite those generated by the template (useful for email resends)
isTestbooleanNo (default=false)Whether or not this is for a test send