[thelist] CF: Email attachments on the fly

Daniel J. Cody djc at five2one.org
Tue Aug 29 16:22:12 CDT 2000


Oliver Lineham wrote:

> 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.

The collection of data is getting shipped in the body of the email, but
you can't just put a bunch of chars in an attachment field and get it to
go. 

The one thing I can think of is that you could use CFFILE to write the
data out, and use the 'temporary' attribute to create your data as a
temporary file, then throw that file name into the attachment field of
your <cfmail>.. Something like
<cffile action="write" file="/your/file/here.txt"
output="#yourscope.content#" attributes="temporary"> would create the
file, and then you could use the normail <cfmail> attributes to get it
as your attachment.

It would be cool if you could do what you're thinking, but i dunno if it
can be done. Of course, you should wait for Seth or jeff to chime in on
this one too..

Good luck :)

.djc.




More information about the thelist mailing list