Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All about My eSubscribe Project

Status
Not open for further replies.

shirin

Programmer
May 18, 2001
1
US
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:
&quot; Error in CFFILE tag
The form field specified in the CFFILE tag (ATTACHMENT) does not contain an uploaded file. &quot;

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 &quot;&quot;>
<cffile action=&quot;upload&quot;
        filefield=&quot;Form.attachment&quot;		destination=&quot;d:\inetpub\[URL unfurl="true"]wwwroot\mailinglist\&quot;[/URL]
		nameconflict=&quot;Overwrite&quot;>
#File.ClientFile#<cfelse><cfset File.ClientFile= &quot;&quot;></cfif></font>
</td> </tr>
<tr><td><input type=&quot;hidden&quot; name=&quot;attachment&quot; value=&quot;#File.ClientFile#&quot;></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=&quot;saveemail&quot; datasource=&quot;users&quot;>
insert into emails (lists, subject, attachment, body, tagline)
Values ('#form.lists#', '#form.subject#','#form.attachment#', '#form.body#', '#form.tagline#')
</cfquery>


<cfquery name=&quot;sendemail&quot; datasource=&quot;users&quot;>
select * 
from users 
where SelectedList='#form.lists#'
 order by eMail 
</cfquery>

<cfif form.attachment is not &quot;&quot;>
<cffile action=&quot;upload&quot;
        filefield=&quot;Form.attachment&quot;
		destination=&quot;d:\inetpub\[URL unfurl="true"]wwwroot\mailinglist\&quot;[/URL]
		nameconflict=&quot;Overwrite&quot;>
		 
<cfset doc1=&quot;d:\inetpub\[URL unfurl="true"]wwwroot\mailinglist\&quot;[/URL] & #File.ClientFile#>

<cfmail to=&quot;#sendemail.eMail#&quot;
        from=&quot;toosis@co.mo.md.us&quot;
		Subject=&quot;#form.subject#&quot;
        query =&quot;sendemail&quot;>

<cfmailparam file=&quot;#doc1#&quot;>
 
Dear #FName#:

     #form.body#


Tagline: #form.tagline#
</cfmail>

<!--- I'm not sur about the part so I commented out
<cfset doc1=&quot;d:\inetpub\[URL unfurl="true"]wwwroot\mailinglist\&quot;[/URL] & #File.ClientFile#>
<cffile action=&quot;delete&quot;
       file=&quot;doc1&quot;>
--->
		
<cfelse>
<cfmail to=&quot;#sendemail.eMail#&quot;
        from=&quot;toosis@co.mo.md.us&quot;
		Subject=&quot;#form.subject#&quot;
        query =&quot;sendemail&quot;>

 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top