[thelist] CF: Email attachments on the fly

Martin martin at lists.evolt.org
Sat Sep 2 10:21:21 CDT 2000


Daniel J. Cody wrote on 29/8/00 9:45 pm

>> On a ColdFusion based site, I want to make an attachment to a message that
>> is sent out by CFMAIL.  I've looked at the docs and can see plenty of ways
>> to attach a file that actually exists on the disk, but all I want to do is
>> generate the attachment on the fly.
>
>Ol, haven't tried this out but thought aboutit for a while.. Basically,
>no. An attachment (well, almost) has to be a file, not a collection of
>data.

Couldn't you just do it thusly (assuming the file is a binary one):
Take the data
UUencode/base64encode it (rfcs 2045, 2046 & 2049)
Create a mime id (eg ol_funkyMimeAttach.a_time_stamp)
stick the following in the message body:

--your_mime_id
Content-type: application/octet-stream;name=yourfilenamegoeshere
Content-transfer-encoding: base64

your_base64encoded_data
--your_mime_id

99% certain this is doable in Perl, dunno about CF.

Cheers
Martin

------------------------------------------------------------------------
email: martin at members.evolt.org              PGP ID: 0xA835CCCB
  tel: +44 (0)778 068 6418                snailmail: 30 Shandon Place
 http://evolt.org/index.cfm?menu=9&uid=32            Edinburgh, Scotland





More information about the thelist mailing list