Multiple email attachments with Coldfusion

Good Day!! I was hoping to find some assistance with using Coldfusion and email. I have a folder on the server, and that folder has mutliple files related to database records, so each file will have the database id number in front of the file name. Got that part down. What I need to do though is be able to grab the files related to a specific id, and then attach those files to an email. I can easily attach one, and I can also attach multiple files when I have form fields with different names. What I can't seem to be able to do is load multiple files from a cfdirectory query. Any help would be greatly appreciated.
diecasthft01Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gdemariaCommented:
I think you should show your code so we can help debug it..   You should be able to do this using cfmailparam
0
diecasthft01Author Commented:
Here's what I have so far, which isn't much. You'll notice I commented out the <cfform>. I used that to make sure I was getting the file results that I was expecting, which I am. I just can't seem to be able to convert that to a multi attachment email. Now if I have a web page with multiple formswith different names, I can get the multi attachment to work.

<CFDIRECTORY NAME="myfiles1"
DIRECTORY="d:\portal\dev\SupportDocs1\"
  FILTER="*.pdf"
  SORT="DateLastModified DESC">
 
  <!---<cfform>
 
  <CFOUTPUT QUERY="myfiles1">
  <cfinput type="text" name="supportdocs" value="#myfiles1.name#" style="font-size:11px; background-color:FF6"></td></tr>
    </CFOUTPUT></CFform>--->
 
<CFPROCESSINGDIRECTIVE SUPPRESSWHITESPACE="No">
<cfmail
SUBJECT="!!! HIGH PRIORITY !!! APPROVAL - FUNDING DECREASE (UNCLASSIFIED)"
FROM="me@mail.com"
TO="me@mail.com"
CC="me@mail.com">
<cfmailparam file="#myfiles1.name#">

test

</cfmail>
</CFPROCESSINGDIRECTIVE>
0
gdemariaCommented:
I don't think you're trying to send one email for every file, but you want to send a list of files in ONE email, is that right?

Remove the outer loop and just loop around the cfmailparam...

<cfloop query="myFiles1">
   <cfmailparam file="#myfiles1.name#">
</cfloop>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
diecasthft01Author Commented:
Yup, that certainly looks like it will work!!! Thanks Alot!!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.