<cfmail>

Sends e-mail messages by an SMTP server.

Usage

<cfmail
    [query=string]
    [charset=string]
    [mimeattach=string]
    [server=string]
    [proxyuser=string]
    [async=boolean]
    [startrow=number]
    [password=string]
    [maxrows=number]
    [sendtime=datetime]
    from=object
    [timeout=number]
    [username=string]
    [listener=any]
    [proxyport=number]
    [usetls=boolean]
    [proxypassword=string]
    [remove=boolean]
    [wraptext=number]
    subject=string
    [failto=object]
    [to=object]
    [mailerid=string]
    [proxyserver=string]
    [priority=String]
    [usessl=boolean]
    [cc=object]
    [groupcasesensitive=boolean]
    [type=string]
    [port=number]
    [replyto=object]
    [group=string]
    [bcc=object]
><!--- body ---></cfmail>

This tag must have a body.

This tag is also supported within cfscript

Attributes

Attribute Description
query
(string, optional)

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.

charset
(string, optional)

Character encoding of the mail message

mimeattach
(string, optional)

Specifies the path of the file to be attached to the e-mail message. An attached file is MIME-encoded.

server
(string, optional)

The address of the SMTP server to use for sending messages. If no server is specified, the server name specified in the Lucee Administrator is used.

proxyuser
(string, optional)

When required by a proxy server, a valid username.

async
(boolean, optional)

if set to true, the mail is sent asynchronously by the Lucee Task manager (with multiple tries), if set to false the mail is sent in the same thread that executes the request, which is useful for troubleshooting because you get an error message if there is one. This setting overrides the setting with the same name in the Lucee Administrator. This attribute replaces the old "spoolenable" attribute which is still supported as an alias.

startrow
(number, optional)

Specifies the row in the query to start from.

password
(string, optional)

A password to send to SMTP servers that require authentication. Requires a username attribute.

maxrows
(number, optional)

Specifies the maximum number of e-mail messages to send.

sendtime
(datetime, optional)

Set a future date time to send an email in the future via the spooler.

from
(object, required)

The sender of the e-mail message.

timeout
(number, optional)

The number of seconds to wait before timing out the connection to the SMTP server.

username
(string, optional)

A user name to send to SMTP servers that require authentication. Requires a password attribute.

listener
(any, optional)
proxyport
(number, optional)

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.

usetls
(boolean, optional)

Whether to use Transport Level Security.

proxypassword
(string, optional)

When required by a proxy server, a valid password.

remove
(boolean, optional)

remove all attachments from filesystem after the mail is successfully sent

wraptext
(number, optional)

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.

subject
(string, required)

The subject of the mail message. This field may be driven dynamically on a message-by-message basis

failto
(object, optional)

Address to which mailing systems should send delivery failure notifications. Sets the mail envelope Return-Path value.

to
(object, optional)

The name of the e-mail message recipient.

mailerid
(string, optional)

Specifies a mailer ID to be passed in the X-Mailer SMTP header, which identifies the mailer application.

proxyserver
(string, optional)

Host name or IP address of a proxy server.

priority
(String, optional)

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.

usessl
(boolean, optional)

Whether to use Secure Sockets Layer.

cc
(object, optional)

Indicates addresses to copy the e-mail message to; "cc" stands for "carbon copy."

groupcasesensitive
(boolean, optional)

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.

type
(string, optional)

Specifies extended type attributes for the message.

port
(number, optional)

The TCP/IP port on which the SMTP server listens for requests. This is normally 25.

replyto
(object, optional)

Address(es) to which the recipient is directed to send replies.

group
(string, optional)

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.

bcc
(object, optional)

Indicates addresses to copy the e-mail message to, without listing them in the message header. "bcc" stands for "blind carbon copy."

Examples

There are currently no examples for this tag.