I will be trying to do this soon as well.

Here is someone's post that I thought may be useful when I try to do this
task.  Let me know how it goes ;)

HTH,
Jeff


One more experienced than I posted this once:  I believe his name is Seth
Bienek

Here's the commented code --

<!--- Create a unique ID for the message boundary. --->
<cfset boundary = CreateUUID()>
<!--- Standard CFMAIL.. Note that the TYPE attribute is not set. --->
<cfmail to="[EMAIL PROTECTED]" from="[EMAIL PROTECTED]" subject="test">
<!--- This message is going to be a multipart message.  Since an email is
really just a really long string of text, we need a unique substring to use
as a seperator between the parts.  Just to make sure that a seperator
doesn't accidentally get typed in, I like to use a UUID - the odds of this
exact string accidentally coming through in an email would be extremely
rare.  The mailparam tag will insert the value of the seperator into the
mail header, as well as telling the email client that this message is
composed of more than one part. --->
<cfmailparam name="Content-Type" value="multipart/alternative;
boundary=""#boundary#""">
<!--- Boundaries are always preceded by "--".  Each part of a multi-part
message is preceded by a boundary.  The boundary value MUST match the value
set in the header. --->
--#boundary#
<!--- Each section of the email gets it's own mini-header.  This header
tells the mail client what kind of data follows (plain text, 8 bit, in this
case), and is always seperated from the content that follows by one empty
line. --->
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

This is the plain text message for the email.
<!--- Every section gets a header, and every header begins with the same
exact Boundary value.  --->
--#boundary#
<!--- Modern mail clients that support HTML email will ignore a plain text
section of an email if there is also an HTML section.  Note the empty line
between the secion header and the content that follows it. --->
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!--- HTML formatted emails should generally be treated the same as html
pages.  Javascript is not allowed, however. The "title" tags are not
supported in most mail readers, but should be used anyway. --->
<html>
<head>
        <title>HTML Message</title>
</head>
<body>
This is the HTML text message for the email.
</body>
</html>
<!--- the final boundary is always followed by two hyphens.  This is how the
email client knows that the message is complete, and not to expect another
section. --->
--#boundary#--
</cfmail>

-----Original Message-----
From: Clint Tredway [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 04, 2001 9:33 AM
To: CF-Talk
Subject: Re: MIME Type email and CF


I am trying to send out a multi-part email that is both text and html with
headers and a boundary so that I can just send one email and let the users
client be able to read it.

Clint




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to