<CFMAIL TO="recipient" FROM="sender" CC="copy_to" SUBJECT="msg_subject" TYPE="msg_type" QUERY="query_name" MAXROWS="max_msgs" MIMEATTACH="path" GROUP="query_column" STARTROW="query_row" SERVER="servername" PORT="port_ID" MAILERID="headerid" TIMEOUT="seconds">
CFMAIL allows you to generate email messages and post them to a specified server.
Required. The name of the recipient(s) of the email message. This can be either a static address (as in, TO="support@allaire.com"), a variable that contains an address (such as, TO="#Form.Email#"), or the name of a query column that contains address information (such as, TO="#EMail#"). In the latter case, an individual email message is sent for every row returned by the query.
Required. The sender of the email message. This attribute may be either static (e.g., FROM="support@allaire.com") or dynamic (as in, FROM="#GetUser.EMailAddress#").
Optional. Indicates additional addresses to copy the email message to. This attribute may also be static or dynamic.
Required. The subject of the mail message. This field may be driven dynamically on a message-by-message basis. For example, if you want to do a mailing that updates customers on the status of their orders, you might use a subject attribute like SUBJECT="Status for Order Number #Order_ID#".
Optional. Specifies extended type attributes for the message. Currently, the only valid value for this attribute is "HTML". Specifying TYPE= "HTML" informs the receiving email client that the message has embedded HTML tags that need to be processed. This is only useful when sending messages to mail clients that understand HTML (such as Netscape 2.0 and above email clients).
Optional. The name of the CFQUERY from which you want to draw data for message(s) you want to send. Specify this attribute to send more than one mail message, or to send the results of a query within a single message.
Optional. Specifies the maximum number of email messages you want to send.
Optional. Specifies the path of the file to be attached to the email message. Attached file is MIME-encoded.
Optional. Specifies the query column to use when you group sets of records together to send as a single email message. For example, if you send a set of billing statements out to your customers, you might group on "Customer_ID." The GROUP parameter, which is case sensitive, eliminates adjacent duplicates in the case where the data is sorted by the specified field.
Optional. Specifies the row in the query to start from.
Required. The address of the SMTP server to use for sending messages. The server name specified in the ColdFusion Administrator is used if no server is specified.
The TCP/IP port on which the SMTP server listens for requests. This is almost always 25.
Optional. Specifies a mailer ID to be passed in the X-Mailer SMTP header, which identifies the mailer application. The default is Allaire ColdFusion Application Server.
Optional. The number of seconds to wait before timing out the connection to the SMTP server.