cfmailparam

Attaches a file or adds a header to an e-mail message. Can only be used in the cfmail tag. You can use more than one cfmailparam tag within a cfmail tag.

Forms tags, Internet Protocol tags

<cfmail 
to = "recipient"
subject = "msg_subject"
from = "sender"
...more attributes... >

<cfmailparam
file = "file-name"
type ="media type">
or
<cfmailparam
name = "header-name"
value = "header-value" >
...
</cfmail>

cfmail, cfmailpart, cfftp, cfhttp, cfldap, cfpop

ColdFusion MX 6.1: Added the type attribute.

Attribute Req/Opt Default Description

file

Required if you do not specify name attribute

 

Attaches file to a message. Mutually exclusive with name attribute. The file is MIME encoded before sending.

type

Optional

 

The MIME media type of the part. Can be a 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/

name

Required if you do not specify file attribute

 

Name of header. Case-insensitive. Mutually exclusive with file attribute.

value

Optional

 

Value of the header.

<h3>cfmailparam Example</h3>
<p>This view-only example uses cfmailparam to attach files and add header to
   a message.</p>
<cfmail from = "[email protected]" To = "[email protected]" 
Subject = "See Important Attachments and Reply"> <cfmailparam name = "Importance" value = "Hich"> Please review the new logo. Tell us what you think. <cfmailparam file = "c:\work\readme.txt" type="text/plain"> <cfmailparam file = "c:\work\logo.gif" type="image/gif"> </cfmail>

View comments on LiveDocs