Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
fs22 #1
CFMail Dynamic Attachment
Greetings, I have a form that a user fills out and it sudmits to a page that
uses cfmail. That cfmail tag sends an attachment to a web admin. The attachment
is a html page. This page is used on the users website. Here is my question...
Is it possible to dynamically write to the html attachment on the fly when the
form is submitted so that the dynamically generated info is included in the
attachment? For example, a user puts in their street address. When the form is
submitted, the html attachment gets sent to a web person. I want the users
address to be in a specified location on the html page. If anyone knows how to
do this, can you point me in the right direction? ~Clay
fs22 Guest
-
cfmail attachment
Can someone help Please. Not till I read a message in this board did I found out that the <cfmailparam file> tag only uploads files from the... -
CF5 cfmail sending blank .txt attachment
we're having a wierd problem with CF5 CFMAIL. We sent out 350 emails and 300 were sent out with the correct attachment and 50 were sent out with... -
CFMAIL change attachment file content
My application has function to export data as textfile. This generated textfile then will be sent via email as attachment. Generated file has... -
cfmail attachment not found on my computer
I've seen many users here in the forum talking about attaching a file using the <cfmailparam> tag, but I can't get it to work. Please help me. Just... -
PHP To Create A Dynamic Text Attachment
Hope someone can help. I am trying to write a php script that will create a text file with dynamic fields in it,save the page and then mail it as an... -
StokeyTCI #2
Re: CFMail Dynamic Attachment
I do it like this: <cfquery name='inputdet' datasource='solicit'> insert into
reqdetail (ID, reqdetail) values ('#form.id#', '#form.details#') </cfquery>
<cfquery name='getdetails' datasource='solicit'> Select tracknum, summary,
bydate, priorty, type, address From reqinfo Where tracknum = '#form.id#'
</cfquery> <cfoutput query='getdetails'> <cfmail to='xxxxxxx@xxxx.com'
from='xxxxx' subject='#form.subject#' server='xxxxxxx' type='html' >
<br> Summary:&nbsp;&nbsp; <strong>#summary#</strong><br> <br>
Priorty:&nbsp;&nbsp;<strong>#priorty#</strong><br> <br> Due
on:&nbsp;&nbsp;<strong>#dateformat(bydate) #</strong><br> <br>
Details:&nbsp;&nbsp; <strong>#form.details#</strong> address:
#address# </cfmail> </cfoutput> I think thats what your talking about. Form.id
is a hidden field in my form I run the query after the insert, that way I can
pass the values in a cfoutput, that way I don't have to send an attachment.
Cheers Chris
StokeyTCI Guest
-
fs22 #3
Re: CFMail Dynamic Attachment
In this case, I need to send the attachment and I am not inserting the data into a database. Is there a way to do it without inserting?
~Clay
fs22 Guest
-
StokeyTCI #4
Re: CFMail Dynamic Attachment
you can pass the form variables without imputing to the database, just loose the query, and wrap the form variables in a <cfoutput> #form.variables#</cfoutput>
StokeyTCI Guest
-
fs22 #5
Re: CFMail Dynamic Attachment
How do I pass those variables to my attachment?
~Clay
fs22 Guest
-
Stressed_Simon #6
Re: CFMail Dynamic Attachment
You need to create the HTML file using <cffile action="write"> then add it via
cfmailparam DO NOT delete the file right away as the email is not always sent
immediately and if you delete the file it wont be able to attach it.
You will probably need to use cfschedule to clear out old items on a regular
basis.
Stressed_Simon Guest
-
fs22 #7
Re: CFMail Dynamic Attachment
My difficulty with the cffile tage is that when I put my html code in the
output field, I generate an error due to the tags in my html code. Is there a
way to fix this? If so, then I can do what I am attempting.
fs22 Guest
-
Stressed_Simon #8
Re: CFMail Dynamic Attachment
Use cfsavecontent to set it to a variable and then use cffile to save that!
Stressed_Simon Guest
-
fs22 #9
Re: CFMail Dynamic Attachment
Thanks for the assist and I sort of got it to work. Here is a sampling of my
code...
<cfset page = "<%Response.Buffer = True%>
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
<html>
<head>
<title>iNet Home Page</title>
</head>
<body onLoad='window.focus()'>
etc... etc...
<cffile action="write" output="#page#"
file="E:\inetpub\wwwroot\legacyweb\isg\education\i net\inetsetupform\templates\op
aol.htm">
<cfmail from="clay.hess@activant.com" to="clay.hess@activant.com"
subject="#FORM.Store_Name#'s #FORM.subject#"
mimeattach="E:\inetpub\wwwroot\legacyweb\isg\educa tion\inet\inetsetupform\templa
tes\opaol.htm">
</cfmail>
I get this code to work, but my problem is that I use the <style></style> tags
on the original page and that seems to mess things up due to the semi-colon at
the end of each style tag line.
How do I get around this?
~Clay
fs22 Guest



Reply With Quote

