CFMAILPART  
Description

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.

 
Category

Internet Protocol tags

 
Syntax
<cfmail 
   ... >
   (Optional cfmailparam entries)
   <cfmailpart 
      type="mime type"
      charset="character encoding"
      wraptext="number"
   >
   Mail part contents
</cfmailpart>
   ...
</cfmail>
 
History

ColdFusion MX 6.1: Added this tag.

 
See also

cfmail, cfmailparam, cfpop, cfftp, cfhttp, cfldap, cfcontent, Wrap; "E-mail" in Chapter 17, "Developing Globalized Applications," in ColdFusion MX Developer's Guide

 
Usage

Use this tag to create mail messages with alternative versions of the message that duplicate the content in multiple formats. The most common use is to send a plain text version of the message that can be read by all mail readers followed by a version formatted in HTML for display by HTML-compatible mail readers. Specify the simplest version first, with more complex versions afterwards. For more information, see www.ietf.org/rfc/rfc2046.txt.

 
Example
<h3>cfmailpart Example</h3>
<cfmail from = "peter@domain.com" To = "paul@domain.com" 
Subject = "Which version do you see?">
   <cfmailpart 
      type="text"
      wraptext="74">
         You are reading this message as plain text, because your mail reader 
         does not handle HTML text.
   </cfmailpart>>
   <cfmailpart 
      type="html">
         <h3>HTML Mail Message</h3>
         <p>You are reading this message as <strong>HTML</strong>.</p>
         <p>Your mail reader handles HTML text.</p>
   </cfmailpart>
</cfmail>
TYPE  
  Required
 

The MIME media type of the part. Can be a can be valid MIME media type or one of the following:

  • text: specifies text/plain type.
  • plain: specifies text/plain type.
  • html: specifies text/html type.
Note: For a list of all registered MIME media types, see www.iana.org/assignments/media-types/.
WRAPTEXT  
  Optional
 
Default value: "Do not wrap text"

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  
  Optional
 
Default value: "Character encoding specified by charset attribute of cfmail tag"

The character encoding in which the part text is encoded. The following list includes commonly used values:

  • utf-8
  • iso-8859-1
  • windows-1252
  • us-ascii
  • shift_jis
  • iso-2022-jp
  • euc-jp
  • euc-kr
  • iso-2022-kr
  • big5
  • hz-gb-2312
  • euc-cn
  • utf-16

For more information on character encodings, seewww.w3.org/International/O-charset.html.