Skip to main content
Inspiring
January 15, 2009
Question

cfmail file attachements

  • January 15, 2009
  • 1 reply
  • 401 views
I want to dynamically attach a document and send via cfmail.I use various queries to get the recipent names, and unique id info, then retrieve the document that corresponds.

One cfmail documentation says to use cfparam inside cfmail and specifiy the full path. Another says to use the mimeattach attribute with the full path.

This is where I am having the problem. My document name/variable from my query is #qryName.document#.
How do I set this up with the path, in either cfparam or mimeattach ?
    This topic has been closed for replies.

    1 reply

    Inspiring
    January 15, 2009
    I attached a brief snippet of code I use in an application that sends an XLS report to a group of recipients each night. Basically, a scheduled task runs, creates an XLS file with a dynamic name, stores it in a particular location on the server and then attaches it to the email.

    Hope it helps!
    trojnfnAuthor
    Inspiring
    January 24, 2009
    I understand your code, but I still cannot seem to get the correct path.

    I use this query to find th file that I want as an attachement to the cfmail :
    <cfquery name="qryName" datasource="dbname">
    select
    uploadFileName
    from tableName
    where docNo = '#form.DocNo#'
    </cfquery>

    So the file that was uploaded with this docNo is stored in a variable named uploadFileName in the specifield table.

    What is the full path that I would setup in cfmailparam so that this documant is an attachemetn in cfmail ?