Tag <CFMAIL>
Sends e-mail messages by an SMTP server.
Body
This tag must have a body.
Example
<cfmail [bcc="object"] [cc="object"] [charset="string"] [failto="object"] from="object" [group="string"] [groupcasesensitive="boolean"] [mailerid="string"] [maxrows="number"] [mimeattach="string"] [password="string"] [port="number"] [priority="String"] [proxypassword="string"] [proxyport="number"] [proxyserver="string"] [proxyuser="string"] [query="string"] [remove="boolean"] [replyto="object"] [secure="boolean"] [server="string"] [spoolenable="boolean"] [ssl="boolean"] [startrow="number"] [starttls="boolean"] subject="string" [timeout="number"] [tls="boolean"] [to="object"] [type="string"] [username="string"] [usessl="boolean"] [usetls="boolean"] [wraptext="number"]> </cfmail>
This tag is also supported within cfscript
<cfscript> mail [bcc="object"] [cc="object"] [charset="string"] [failto="object"] from="object" [group="string"] [groupcasesensitive="boolean"] [mailerid="string"] [maxrows="number"] [mimeattach="string"] [password="string"] [port="number"] [priority="String"] [proxypassword="string"] [proxyport="number"] [proxyserver="string"] [proxyuser="string"] [query="string"] [remove="boolean"] [replyto="object"] [secure="boolean"] [server="string"] [spoolenable="boolean"] [ssl="boolean"] [startrow="number"] [starttls="boolean"] subject="string" [timeout="number"] [tls="boolean"] [to="object"] [type="string"] [username="string"] [usessl="boolean"] [usetls="boolean"] [wraptext="number"] { } </cfscript>
Attributes
The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
Name | Type | Required | Description |
---|---|---|---|
bcc | any | No | Indicates addresses to copy the e-mail message to, without listing them in the message header. "bcc" stands for "blind carbon copy." |
cc | any | No | Indicates addresses to copy the e-mail message to; "cc" stands for "carbon copy." |
charset | string | No | Character encoding of the mail message |
failto | any | No | Address to which mailing systems should send delivery failure notifications. Sets the mail envelope reverse-path value. |
from | any | Yes | The sender of the e-mail message. |
group | string | No | Specifies the query column to use when you group sets of records together to send as an e-mail message. For example, if you send a set of billing statements to customers, you might group on "Customer_ID." The group attribute, which is case sensitive, eliminates adjacent duplicates when the data is sorted by the specified field. See the Usage section for exceptions. |
groupcasesensitive | boolean | No | Boolean indicating whether to group with regard to case or not. The default value is NO; case is considered while grouping. If the query attribute specifies a query object that was generated by a case-insensitive SQL query, set the groupCaseSensitive attribute to NO to keep the recordset intact. |
mailerid | string | No | Specifies a mailer ID to be passed in the X-Mailer SMTP header, which identifies the mailer application. |
maxrows | number | No | Specifies the maximum number of e-mail messages to send. |
mimeattach | string | No | Specifies the path of the file to be attached to the e-mail message. An attached file is MIME-encoded. |
password | string | No | A password to send to SMTP servers that require authentication. Requires a username attribute. |
port | number | No | The TCP/IP port on which the SMTP server listens for requests. This is normally 25. |
priority | String | No | The message priority level. Can be one of the following values: * An integer in the range 1-5; 1 represents the highest priority. * One of the following string values, which correspond to the numeric values: highest or urgent, high, normal, low, and lowest or non-urgent. |
proxypassword | string | No | When required by a proxy server, a valid password. |
proxyport | number | No | The port number on the proxy server from which the object is requested. Default is 80. When used with resolveURL, the URLs of retrieved documents that specify a port number are automatically resolved to preserve links in the retrieved document. |
proxyserver | string | No | Host name or IP address of a proxy server. |
proxyuser | string | No | When required by a proxy server, a valid username. |
query | string | No | The name of the cfquery from which to draw data for message(s) to send. Specify this attribute to send more than one mail message, or to send the results of a query within a message. |
remove | boolean | No | remove all attachments from filesystem after the mail is successfully sent |
replyto | any | No | Address(es) to which the recipient is directed to send replies. |
secure | boolean | No | alias for ssl |
server | string | No | The address of the SMTP server to use for sending messages. If no server is specified, the server name specified in the Railo Administrator is used. |
spoolenable | boolean | No | Specifies whether to spool mail or always send it Immediately. Overrides the Railo Administrator spool mail messages to disk for delivery setting. |
ssl | boolean | No | alias for usessl |
startrow | number | No | Specifies the row in the query to start from. |
starttls | boolean | No | alias for useTls |
subject | string | Yes | The subject of the mail message. This field may be driven dynamically on a message-by-message basis |
timeout | number | No | The number of seconds to wait before timing out the connection to the SMTP server. |
tls | boolean | No | alias for usetls |
to | any | No | The name of the e-mail message recipient. |
type | string | No | Specifies extended type attributes for the message. |
username | string | No | A user name to send to SMTP servers that require authentication. Requires a password attribute. |
usessl | boolean | No | Whether to use Secure Sockets Layer. |
usetls | boolean | No | Whether to use Transport Level Security. |
wraptext | number | No | Specifies the maximum line length, in characters of the mail text. If a line has more than the specified number of characters, replaces the last white space character, such as a tab or space, preceding the specified position with a line break. If there are no white space characters, inserts a line break at the specified position. A common value for this attribute is 72. |