I wrote a cfmail app that allows you to send one attachment. Everything about it works fine. The problem is, it's sending 2 of the uploaded image and I can't figure out why. I'm not going to put in all my error code and so on, I'm just showing my cffile, and then the main part of my cfmail, I believe the problem is in how I'm attaching my file that is to be uploaded from the user.
<cfmailparam name="X-Priority" value="1"/>
This is all my email stuff from the forms
<cfif FORM.attachment_1 neq "">
<cfmailparam file="#CFFILE.ServerDirectory#/#CFFILE.ServerFile#" remove="true"/>
and that's the main part of it aside from the form to send, and error control and those things.
Can anyone see what I'm doing wrong here? possibly help me fix my issue?
You have 2 cfmailparam tags therefore there are 2 copies of the attachment. Remove the cfmailparam outside the cfif statement. You may need to add the delete="true" to the cfmailparam inside the cfif tag.
Thank you! that worked. I was over thinking the process. Using a 2nd tag to delete the image on the server and I didn't need too. did what you said and it works perfect.