Skip to main content
Known Participant
January 21, 2010
Answered

cfloop query ti cfmail missing first attachement

  • January 21, 2010
  • 1 reply
  • 705 views

<cfquery name="895" datasource="85964">
SELECT name FROM 568 WHERE ID = #ID#
</cfquery>         

<cfloop query = "895">
<cfmail to="#form.email#" from="xx@xx.com" subject="#form.subject#" type="html">
<cfoutput><pre>#form.body#</pre></cfoutput>
<cfoutput><cfmailparam file="/45/#name#" type="application/pdf" /></cfoutput>
</cfmail>
</cfloop>

<cfdump var="#pdf_list#">

it dumps out 4 pdfs names but it send out only 3 every times it missies first file

    This topic has been closed for replies.
    Correct answer Jeff Coughlin

    Great.  Thanks for the update.

    If you get a chance, please mark this topic as answered.

    1 reply

    Inspiring
    January 25, 2010

    Do you have any specific details you can share?

    • CF version
    • DBType / DB driver
    • Are you positive the query is returning (4) PDF files?
      • Can you verify this by just dumping the query instead of using cfmail?
    • Are you really naming you query with an invalid naming convention (varname = 895?)? (or were you just trying to use filler var names for this example)
    • Since you're not var-scoping (shame, shame), can you tell us what var scope the variable #pdf_list# is in and where it is being pre-defined?

    --

    JeffC

    Known Participant
    January 25, 2010

    hi thanks for replay, but I figured out the issue, everything is fine its size of pdf which makes that pdf undeliverable.

    Jeff CoughlinCorrect answer
    Inspiring
    January 25, 2010

    Great.  Thanks for the update.

    If you get a chance, please mark this topic as answered.