I know that in CFMAIL you can send attachment for file which already pre existed.
however, how to make CFMAIL content as an attachment (for example as html file) and as the same time, send out email???? Any help would be apprciated. Thanks.
I've never tested this but in theory you should be able to use <CFFILE Action="write"
File="C:\temp\temp.html"
output=" #MYHTMLCONTENT# ">
to create the HTML file then attatch it with <CFMAIL ...
The only problem I can see with this is picking a file name. depending on how many people could be using this application you might need to make a filename system like:
temp#CFID#.html
so that each person would have there own temp html file to Attatch.
<p>This is your class schedule</p>:
<table>
</table>.....
.....
</cfmail>
where do i put CFFILE tag?? I was guessing it should be out the CFMAIL,
what about the output content, how do specify that #MYHTMLCONTEN# variable that you gave in your example???
That will do a simple table with your Query Data. It's a little anoying but it works.
Just be careful of quotes inside the output =" " string, change them to ' .
The idea is to put the <CFFILE action="Append" ...> Wherever you would have put the formatting for the data that you would have put on the screen. Put the formatting and data instead into the output = " ..." string.
This works for me. I hope I got the right question this time.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.