Name

cfmail

Synopsis

                  <cfmail>
  [<cfmailparam>]

  [<cfmailpart>
  message body
  </cfmailpart>]
  ...
</cfmail>

Generates an email message and sends it through a designated SMTP server. New in ColdFusion MX, email addresses that contain spaces cause the cfmail tag to throw an exception. In prior versions, ColdFusion would still generate the mail spool file, even though it contained an invalid email address. Email address may be specified using any of the following formats:

pmoney@example.com
<pmoney@example.com>
pmoney@example.com (Pere Money)
“Pere Money” <pmoney@example.com>
Pere Money <pmoney@example.com>

Attributes

from=" sender "

The sender of the message. May be an email address or other arbitrary string. Required.

to=" recipient "

Recipient’s email address. Separate multiple recipients with commas. Required.

subject=" subject "

The subject of the email. Required.

bcc=" blind_copy_to "

A list of recipients to send blind copies of the email. bcc recipients aren’t shown in the email header. Separate multiple recipients with commas. Optional.

charset=" charset "

Specifies the character set to use in encoding the message. The most common character sets are UTF-8, UTF-16, UTF-16BE, UTF-16LE, US-ASCII, and ISO-8859-1. You may use any character set supported by your JRE. Optional. The default is the character encoding specified in the Mail section of the Server Settings area in the ColdFusion Administrator. By default, this is set to UTF-8. This attribute is new in ColdFusion MX 6.1.

cc=" ...

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.