Hi,
I'm creating an eSubscribe using <cfmail>. My problem is the Administration part.The persone who want to send eMail to all people in that list should preview the email and then send it. On my action page I have two <cfquery>s, one to save emails on an usual Access table, the other one to send eMails.
When there is no attachement the saving query works fine but no eMail will be sent. When there is attachement I receive this Error message:
" Error in CFFILE tag
The form field specified in the CFFILE tag (ATTACHMENT) does not contain an uploaded file. "
On the preview eMail page I used <cffile>tage to Upload the Clientfile the server to be able to view that attachement and I have the same input field as Hidden field to pass it to the action page to be saved and sent. Here is the code:
On the Action page I have the same cffile ( I think the problem lied down here, But I have to preview my attachement!) Here is what I have on the Action page:
That is all I did so far and I don't know what else I should do to make it work. I count on you guys to give me a hint. Thanks
I'm creating an eSubscribe using <cfmail>. My problem is the Administration part.The persone who want to send eMail to all people in that list should preview the email and then send it. On my action page I have two <cfquery>s, one to save emails on an usual Access table, the other one to send eMails.
When there is no attachement the saving query works fine but no eMail will be sent. When there is attachement I receive this Error message:
" Error in CFFILE tag
The form field specified in the CFFILE tag (ATTACHMENT) does not contain an uploaded file. "
On the preview eMail page I used <cffile>tage to Upload the Clientfile the server to be able to view that attachement and I have the same input field as Hidden field to pass it to the action page to be saved and sent. Here is the code:
Code:
<cfif form.attachment is not "">
<cffile action="upload"
filefield="Form.attachment" destination="d:\inetpub\[URL unfurl="true"]wwwroot\mailinglist\"[/URL]
nameconflict="Overwrite">
#File.ClientFile#<cfelse><cfset File.ClientFile= ""></cfif></font>
</td> </tr>
<tr><td><input type="hidden" name="attachment" value="#File.ClientFile#"></td></tr>
On the Action page I have the same cffile ( I think the problem lied down here, But I have to preview my attachement!) Here is what I have on the Action page:
Code:
<cfquery name="saveemail" datasource="users">
insert into emails (lists, subject, attachment, body, tagline)
Values ('#form.lists#', '#form.subject#','#form.attachment#', '#form.body#', '#form.tagline#')
</cfquery>
<cfquery name="sendemail" datasource="users">
select *
from users
where SelectedList='#form.lists#'
order by eMail
</cfquery>
<cfif form.attachment is not "">
<cffile action="upload"
filefield="Form.attachment"
destination="d:\inetpub\[URL unfurl="true"]wwwroot\mailinglist\"[/URL]
nameconflict="Overwrite">
<cfset doc1="d:\inetpub\[URL unfurl="true"]wwwroot\mailinglist\"[/URL] & #File.ClientFile#>
<cfmail to="#sendemail.eMail#"
from="toosis@co.mo.md.us"
Subject="#form.subject#"
query ="sendemail">
<cfmailparam file="#doc1#">
Dear #FName#:
#form.body#
Tagline: #form.tagline#
</cfmail>
<!--- I'm not sur about the part so I commented out
<cfset doc1="d:\inetpub\[URL unfurl="true"]wwwroot\mailinglist\"[/URL] & #File.ClientFile#>
<cffile action="delete"
file="doc1">
--->
<cfelse>
<cfmail to="#sendemail.eMail#"
from="toosis@co.mo.md.us"
Subject="#form.subject#"
query ="sendemail">
Dear #FName#:
#form.body#
Tagline: #form.tagline#
</cfmail>
</cfif>
That is all I did so far and I don't know what else I should do to make it work. I count on you guys to give me a hint. Thanks