cfmail and attachments. A problem
I am trying to use the cfmail option to email ads submitted to our website. While the copy will come over just fine, whenever I try to add an image as an attachment, I get the following error:
Security: The requested template has been denied access to image.jpg
The code I am using to process the file and send the mail is as follows:
<cfif Len(attributes.adgraphic) GT 0>
<cftry>
<cffile action="upload"
nameconflict="makeunique"
filefield="adgraphic"
destination="/home/content/b/o/a/boatsandharbor/html/"
>
<cfcatch>
<cfset File.ServerFile = "">
</cfcatch>
</cftry>
<cfelse>
<cfset File.ServerFile = "">
</cfif>
and:
<cfmail to="#Application.orderEmail#" from="automated@boats-and-harbors.com" subject="New Display Ad" mimeattach="#File.ServerFile#">
Name: #attributes.name#
Company: #attributes.company#
Phone: #attributes.phone#
Email: #attributes.email#
Address: #attributes.address#
City: #attributes.city#
State: #attributes.state#
Zipcode: #attributes.zip#
Fax: #attributes.fax#
Ad Size: #sizeOfAd#
Copy: #adCopy#
</cfmail>
Can anyone tell me what the problem is? It's really getting me frustrated!
Jason
