Reputation: 938
My application requires me to create an XML document and send it to the user as an attachment. I would like to know if there is any way to create an XML document and send it as an attachment without saving the file to the server? The reason I am asking this is that there will be many emails being sent and I don't want to overload the server with files. If there is no way to do this I realize that I could just save the file, send it in an email, and then delete the file. However it would be a lot easier if I could just create the file and send it without saving. I have seen this done with a PDF where you create the PDF using <cf document>
and send it as a parameter using <cfmailparam>
, is there anything similar for XML?
Upvotes: 2
Views: 661
Reputation: 13548
As others have mentioned in the comments, you should be able to use the same logic that you used for the PDF delivery and apply it to the XML delivery. We could help you more if you would include your code.
Or you can have ColdFusion handle the file removal for you automatically. Another attribute to the <cfmailparam>
tag that you mentioned is "remove". If you include the "remove" attribute and set it to true, ColdFusion removes attachment files (if any) after the mail is successfully delivered. Added in ColdFusion 8.0.1 along with the "content" attribute that you are using. Documented here
Upvotes: 2