Professional Web Applications Themes

Error CFOUTPUT tag is nested inside a CFMAIL tag - Coldfusion - Advanced Techniques

Hi I am trying to generate some CFMAIL that gives me all the values out of a table but get an error Here is my code <cfset emailto = "#Email.EmailAddress#"> <cfmail to=#emailto# from="com" subject="!!! ONLINE PHOTO SALE !!!" server="mail.krisflanagan.com"> <cfoutput query="GetCustomerDetails"> Image Name: #GetOrderDetails.Image# Frame: #GetOrderDetails.Frame# Print Size: #GetOrderDetails.Size# Qunatity: #LSNumberFormat(GetOrderDetails.Quantity)# Unit Price: #DollarFormat(GetOrderDetails.Price)# Shipping Cost: #DollarFormat(GetOrderDetails.ShippingCost)# PriceSet: #GetOrderDetails.PriceID# PhotoDatabaseID: #GetOrderDetails.PhotoDatabaseID# </cfoutput> PAYMENT DETAILS Sub Total: #DollarFormat(GetCustomerDetails.SubTotal)# Freight Cost: #DollarFormat(GetCustomerDetails.FreightCost)# Total Amount inc. Gst: #DollarFormat(GetCustomerDetails.TotalAmount)# Payment Type: #GetCustomerDetails.PaymentType# Date Ordered: #GetCustomerDetails.DateOrdered# </cfmail> Any Ideas?? Thank in Advance...

  1. #1

    Default Error CFOUTPUT tag is nested inside a CFMAIL tag

    Hi
    I am trying to generate some CFMAIL that gives me all the values out of a
    table but get an error
    Here is my code

    <cfset emailto = "#Email.EmailAddress#">

    <cfmail to=#emailto#
    from="com"
    subject="!!! ONLINE PHOTO SALE !!!"
    server="mail.krisflanagan.com">

    <cfoutput query="GetCustomerDetails">
    Image Name: #GetOrderDetails.Image#
    Frame: #GetOrderDetails.Frame#
    Print Size: #GetOrderDetails.Size#
    Qunatity: #LSNumberFormat(GetOrderDetails.Quantity)#
    Unit Price: #DollarFormat(GetOrderDetails.Price)#
    Shipping Cost: #DollarFormat(GetOrderDetails.ShippingCost)#
    PriceSet: #GetOrderDetails.PriceID# PhotoDatabaseID:
    #GetOrderDetails.PhotoDatabaseID#
    </cfoutput>

    PAYMENT DETAILS

    Sub Total: #DollarFormat(GetCustomerDetails.SubTotal)#
    Freight Cost: #DollarFormat(GetCustomerDetails.FreightCost)#
    Total Amount inc. Gst: #DollarFormat(GetCustomerDetails.TotalAmount)#
    Payment Type: #GetCustomerDetails.PaymentType#
    Date Ordered: #GetCustomerDetails.DateOrdered#
    </cfmail>

    Any Ideas??
    Thank in Advance

    wheres Guest

  2. #2

    Default Error CFOUTPUT tag is nested inside a CFMAIL tag

    Hi
    I am trying to generate some CFMAIL that gives me all the values out of a
    table but get an error
    Here is my code

    <cfset emailto = "#Email.EmailAddress#">

    <cfmail to=#emailto#
    from="com"
    subject="!!! ONLINE PHOTO SALE !!!"
    server="mail.krisflanagan.com">

    <cfoutput query="GetCustomerDetails">
    Image Name: #GetOrderDetails.Image#
    Frame: #GetOrderDetails.Frame#
    Print Size: #GetOrderDetails.Size#
    Qunatity: #LSNumberFormat(GetOrderDetails.Quantity)#
    Unit Price: #DollarFormat(GetOrderDetails.Price)#
    Shipping Cost: #DollarFormat(GetOrderDetails.ShippingCost)#
    PriceSet: #GetOrderDetails.PriceID# PhotoDatabaseID:
    #GetOrderDetails.PhotoDatabaseID#
    </cfoutput>

    PAYMENT DETAILS

    Sub Total: #DollarFormat(GetCustomerDetails.SubTotal)#
    Freight Cost: #DollarFormat(GetCustomerDetails.FreightCost)#
    Total Amount inc. Gst: #DollarFormat(GetCustomerDetails.TotalAmount)#
    Payment Type: #GetCustomerDetails.PaymentType#
    Date Ordered: #GetCustomerDetails.DateOrdered#
    </cfmail>

    Any Ideas??
    Thank in Advance

    wheres Guest

  3. #3

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    You cannot use cfoutput inside cfmail, it is already implied.

    If you need to loop through a query you have to use cfloop.

    HTH
    Stressed_Simon Guest

  4. #4

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    Or, you can process all that cfoutput stuff before the cfmail tag, and wrap it
    in a cfsavecontent tag. Then use the resulting variable in the cfmail tag.

    Originally posted by: Stressed_Simon
    You cannot use cfoutput inside cfmail, it is already implied.

    If you need to loop through a query you have to use cfloop.

    HTH



    Dan Guest

  5. #5

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    Don't think you can nest cfoutput tags inside of cfmail. Try this...

    <cfset emailto = "#Email.EmailAddress#">

    <cfmail to=#emailto#
    from="com"
    subject="!!! ONLINE PHOTO SALE !!!"
    server="mail.krisflanagan.com">
    Image Name: #GetOrderDetails.Image#
    Frame: #GetOrderDetails.Frame#
    Print Size: #GetOrderDetails.Size#
    Qunatity: #LSNumberFormat(GetOrderDetails.Quantity)#
    Unit Price: #DollarFormat(GetOrderDetails.Price)#
    Shipping Cost: #DollarFormat(GetOrderDetails.ShippingCost)#
    PriceSet: #GetOrderDetails.PriceID# PhotoDatabaseID:
    #GetOrderDetails.PhotoDatabaseID#

    PAYMENT DETAILS

    Sub Total: #DollarFormat(GetCustomerDetails.SubTotal)#
    Freight Cost: #DollarFormat(GetCustomerDetails.FreightCost)#
    Total Amount inc. Gst: #DollarFormat(GetCustomerDetails.TotalAmount)#
    Payment Type: #GetCustomerDetails.PaymentType#
    Date Ordered: #GetCustomerDetails.DateOrdered#
    </cfmail>

    BSterner Guest

  6. #6

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    I don't think this will work as I need to loop through all of the records in
    the GetCustomerDetails query and display all of them in the the email to the
    customer.

    Your code by the look of it will only get the first record.

    Thanks Kris



    <cfmail to=#emailto#
    from="com"
    subject="!!! ONLINE PHOTO SALE !!!"
    server="mail.krisflanagan.com">

    <cfoutput query="GetOrderDetails">
    Image Name: #GetOrderDetails.Image#
    Frame: #GetOrderDetails.Frame#
    Print Size: #GetOrderDetails.Size#
    Qunatity: #LSNumberFormat(GetOrderDetails.Quantity)#
    Unit Price: #DollarFormat(GetOrderDetails.Price)#
    Shipping Cost: #DollarFormat(GetOrderDetails.ShippingCost)#
    PriceSet: #GetOrderDetails.PriceID# PhotoDatabaseID:
    #GetOrderDetails.PhotoDatabaseID#
    </cfoutput>

    PAYMENT DETAILS

    Sub Total: #DollarFormat(GetCustomerDetails.SubTotal)#
    Freight Cost: #DollarFormat(GetCustomerDetails.FreightCost)#
    Total Amount inc. Gst: #DollarFormat(GetCustomerDetails.TotalAmount)#
    Payment Type: #GetCustomerDetails.PaymentType#
    Date Ordered: #GetCustomerDetails.DateOrdered#
    </cfmail>

    wheres Guest

  7. #7

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    If you need to loop through something, cold fusion has a tag for that. It's
    called cfloop. Instructions for using it are in the cfml reference manual.

    Originally posted by: wheres kris
    I don't think this will work as I need to loop through all of the records in
    the GetOrderDetails query and display all of them in the the email to the
    customer.

    Your code by the look of it will only get the first record.




    Dan Guest

  8. #8

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    Hi thanks for the replies

    So CFLOOP will work nested inside a CFMAIL tag but a CFOUTPUT tag won't work
    inside a CFMAIL TAG is this correct ?
    How would i simply get it to loop through all the records in the
    GetOrderDetails query and display them in the cfmail ??

    Thanks Kris

    wheres Guest

  9. #9

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    Same way you'd use cfoutput. Did you check the manuals as Dan suggested?

    <cfloop query="GetUserdetails">
    ....
    </cfloop>

    BSterner Guest

  10. #10

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    :) Thanks For the Help
    I couldn't find the referance manual in a rush but I have now
    wheres Guest

  11. #11

    Default Re: Error CFOUTPUT tag is nested inside a CFMAIL tag

    If you can't find the manual, google the tag, complete with angle brackets. The
    internet version of the manual will be one of the first things you are offered.
    If appropriate, add the version number.
    eg
    <cfloop> 6
    in the google textbox should give you the cfml reference manual version 6
    information on cfloop.

    Originally posted by: wheres kris
    :) Thanks For the Help
    I couldn't find the referance manual in a rush but I have now



    Dan Guest

Similar Threads

  1. CFTRY inside a CFOUTPUT loop
    By Mike.Tennor in forum Coldfusion - Advanced Techniques
    Replies: 18
    Last Post: August 16th, 06:30 AM
  2. CFMAIL nexted in CFOUTPUT not sending all emails
    By carlu in forum Macromedia ColdFusion
    Replies: 3
    Last Post: March 30th, 04:59 PM
  3. CFSchedule, CFmail and CFoutput
    By DaniFusionWeb in forum Macromedia ColdFusion
    Replies: 11
    Last Post: March 14th, 06:55 PM
  4. recordcount of a nested cfoutput ....
    By Shaffer in forum Coldfusion - Advanced Techniques
    Replies: 4
    Last Post: February 23rd, 02:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139