cfmailpart

Specifies one part of a multipart e-mail message. Can only be
used in the cfmail tag. You can use more than one cfmailpart
tag within a cfmail tag.

  <cfmailpart type="text/plain">

 cfmailpart(type="text/plain");

Attribute Reference

type string
Required

The MIME media type of the part. Can be a valid MIME
media type
Values:
  • text/plain
  • text/html

wraptext numeric

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.

charset string

The character encoding in which the part text is encoded.

For more information on character encodings, see:
www.w3.org/International/O-charset.html.
Values:
  • utf-8
  • iso-8859-1
  • windows-1252
  • us-ascii
  • shift_jis
  • iso-2022-jp
  • euc-jp
  • euc-kr
  • big5
  • euc-cn
  • utf-16

Examples
Sample code using the cfmailpart tag

.

cfmail( to = "recipient@example.com", from = "sender@example.com", subject = "Example email" ) {
cfmailpart(type="text/plain") {
	writeOutput("If you are seeing this, your e-mail client does not support HTML messages.");
}
cfmailpart(type="text/html") {
	writeOutput(htmlVersionOfMessage);
}
}

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub