Hi Mo -
What happens is this:
Step 1: User Fills Out Email Form and Selects File(s) From Local Hard Drive
<form method="post" name="EmailThis" action="#CurrentPage#"
enctype="multipart/form-data">
Form Fields Stuff...
<input type="file" name="attachment_1" value="">
</form>
Step2: On Form Submittal - The File(s) are uploaded to the server (This is
done through cffile)
<cffile action="upload"
filefield="attachment_1"
destination="#variables.AttachmentDirectory
#"
nameconflict="Makeunique">
Step 3: Once the files are uploaded to the server - ColdFusion will run
through the cfmail tag to generate an email to the recipients.
Step 4: In the cfmail tag - you use a <cfmailparam> to Add a file as an
attachment to the email. The cfmailparam tag looks to the harddrive on the
web server to attach the file.
<cfmail
type="html"
to="# Variables.RecEmail#"
from="#Variables.SendEmail#"
subject="#variables.EmailSubject#"
>
Your Message Here
<cfif DirectoryExists(#variables.AttachmentDirectory#)>
<cfdirectory
directory="#variables.AttachmentDirectory#"
name="dirQuery"
action="LIST">
<cfloop query="dirQuery">
<cfmailparam
file="#variables.AttachmentDirectory#/#dirQuery.name#">
</cfloop>
</cfif>
</cfmail>
Step 5: After the email is sent - you can then DELETE the file on the
webserver - if you so choose to.
Hope that helps - Nick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5450
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm