Without having tried it, the first thing that springs to mind is to turn off mail spooling.
In theory, attaching files should not be that much of a bother. I think you have to add a header specifying filename, MIME header, etc., and you have to add the file as a base-64 encoded block at the end of the email. Others (Jochem -- I'm looking at you!) could probably advise better about this. HTH --Ben Doom Nathan Wells wrote: > Is there any way to safely delete files that were attached using a > <cfmailparam> tag to an email that was generated with the <cfmail> tag? If > you delete the attached file too soon, then the file doesn't get attached to > the email, at best, and at worst, the email fails altogether. > > <cfmail to="[EMAIL PROTECTED]" to="[EMAIL PROTECTED]" subject="See > Attachment"> > <cfmailparam file="#theFullFilePath#"> > See attached file, #GetFileFromPath(theFullFilePath)# > </cfmail> > <cffile action="delete" file="#theFullFilePath#"> > > I know for a fact that this worked just fine in CF 5, because the contents of > the attached file would be included as a base64 string in the .mail file that > was written to the spool. In the MX versions of CF, only path of the > attached file is put in the .mail file, meaning the attached file had to > stick around until the .mail file in the spool could be processed. > > It seems like a significant feature digression, but I have found zero > documentation on this from Adobe. It is quite a hindrance if you are > attaching (gasp) dynamically generated files to emails to create an entire > separate process to manually clean up the files from the file system. > > Does anybody know how attachments work in CF 8? I haven't tried it yet, and > I would be curious if it works the same as CF 7. > > Has anyone heard of future plans by Adobe to allow attached files to be > automatically deleted after the spool file has been processed. Maybe > something similar to the <cfcontent> tag? > <cfmailparam file="#theFullFilePath#" delete="yes"> > > And finally, has anyone ever tried to somehow force the contents of the file > into the body of the email so it is indeed written to the spool file? > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292095 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

