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
Name | Type | Required | Description |
---|---|---|---|
template | string | No (default="") | Name of the template whose handler will do the rendering, etc. |
recipientId | string | No (default="") | ID of the recipient of the email (for new as of 10.8.0 templated emails only) |
args | struct | No | Structure of arbitrary arguments to forward on to the template handler |
to | array | No | Array of email addresses to send the email to |
from | string | No (default="") | Optional from email address |
subject | string | No (default="") | Optional email subject. If not supplied, the template handler should supply it |
cc | array | No | Optional array of CC addresses |
bcc | array | No | Optional array of BCC addresses |
replyTo | array | No | Optional array of email addresses that replies should go to |
failTo | array | No | Optional array of email addresses that failure notifications should go to |
htmlBody | string | No (default="") | Optional HTML body |
textBody | string | No (default="") | Optional plain text body |
params | struct | No | Optional struct of cfmail params (headers, attachments, etc.) |
resendOf | string | No (default="") | Optional ID of the message log item that is being resent |
returnLogId | boolean | No (default=false) | Should the method return the ID of the sent message instead of a boolean success value |
overwriteTemplateArgs | boolean | No (default=false) | If true, then any arguments passed to this function will overwrite those generated by the template (useful for email resends) |
isTest | boolean | No (default=false) | Whether or not this is for a test send |