ActivMail Bulk Email messaging for ColdFusion, solve CFMAIL problems.
ActivMail - Version
CF_MailAttachment Tag Reference

Use this tag to add an attachment to a message sent with the CF_Mail Tag. This tag is a child tag of CF_Mail so it must be inside its tag body.

See Also: <CF_Mail> and <CF_MailHeader>

Common Attributes

Attribute Name Required Data Type Notes
FILE yes file The path on your server of the file to attach.
NAME no String The name of the attachment that will showup in the email attachment. If you have FILE="/activmail/2_0_0/docs/tag_reference/c123.txt" but want the user to receive a file called "/activmail/2_0_0/docs/tag_reference/attachment.txt" set NAME="/activmail/2_0_0/docs/tag_reference/attachment.txt". If the NAME attribute is not specified the name of the file specified in the FILE attribute will be used ("/activmail/2_0_0/docs/tag_reference/123.txt" in this case).
TYPE no string The value of the Content-Type header of the attachment. For example type="image/gif". If you don't specify a content type then a default content type will be applied depending on the file extention in the NAME attribute. See below for Default Content Types

Advanced Attributes

ENCODING no String Determines how the message will be encoded. Default value is quoted-printable when content type is text/*, otherwise the default is Base64 encoding. Conversion to quoted-printable and base64 is done automatically when those types are specified, if you specify anyother type such as 7bit or 8bit you must ensure that the content is already encoded useing the specifed encoding (encoding is not performed). However the line length will be limited using the value of the LINELENGTH attribute in the CF_Mail tag.
DISPOSITION no String Sets the Content-Disposition header for the attachment. Possible values are inline and attachment. Default is attachment.
CID no String Sets the Content-ID header for the attachment. This header is used most frequently for embeding images in HTML email, see the examples. When CID is not specified the Content-ID header is not used.
ALTERNATIVE no boolean When true specifies that the attachment is an alternative representation of the main email message. For example when you send a multipart message (both text and html) the text message and HTML message are labeled as alternative, this tells the mail client that the content in each part is the same, but is represented in different formats (plain text and HTML). The mail client uses the content type to determine which part it can display to the user. You can use this attribute to add additional parts to your message, by specifying TYPE="text/x-aol" your content can be read by AOL users using AOL 6.0 and below (versions of AOL greater than AOL 6.0 can ready text/html). The default value for this attribute is false. You should specify DISPOSITION="inline" when this attribute is set to true.
CHARSET no string The character set the message is encoded in, us-ascii for example. When the attribute isn't given a value, no header is printed.

Default Content Types

You can override these defaults using the TYPE attribute

File Extension Default Content Type
.txt text/plain
.zip application/x-zip-compressed
.html text/html
.htm text/html
.rtf application/rtf
.doc application/msword
.pdf application/pdf
.gif image/gif
.jpg image/jpeg
.xls application/
*.* application/octet-stream


Sending an attachment

   TO="[email protected],[email protected],[email protected]"
   FROM="Billy Jones <[email protected]>"
   SUBJECT="Billy's got a new cow">

Hi, check out the attached picture of my new cow

    <cf_mailattachment file="/activmail/2_0_0/docs/tag_reference/ccow001.jpg" type="image/jpeg" name="/activmail/2_0_0/docs/tag_reference/billysCow.jpg">


Embeding an image in HTML Email

   TO="[email protected],[email protected],[email protected]"
   FROM="Billy Jones <[email protected]>"
   SUBJECT="Billy's got a new cow">

Hi, check out the picture of my new cow:

<img src="cid:cow" id="cow">

    <cf_mailattachment file="/activmail/2_0_0/docs/tag_reference/ccow001.jpg" type="image/jpeg" cid="cow">


Sending an alternative message part

   TO="[email protected],[email protected],[email protected]"
   FROM="Billy Jones <[email protected]>"
   TEXTMESSAGE="I got a new cow"
   SUBJECT="Billy's got a new cow">

I got a new <b>cow</b>

    <cf_mailattachment file="c:\aol.html" type="text/x-aol" alternative="true" disposition="inline">


ActivMail Documentation

Copyright © CFDEV.COM 2004