use cfmail to do the query.

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pta.htm#wp2355015

there is a query attribute

HTH
will

[EMAIL PROTECTED] wrote:

> I have a formpage that passes to an actionpage and inserts into the
> database.
> I then query the db to retrieve the memberID.
> Now I pass the form data into a CFMail, however I am unable to pass the
> CFQuery data into the CFMail contents.
> I have been trying CFLoop without success, how do I put the query
> information into the CFMail?
>
> Thanks
> Steve
>
> <!--- ACTIONPAGE --->
>
> <!--- insert data --->
> <cfinsert datasource="Mysql"
>     username="Myname"
>     password="Mypass"
>     tablename="resolve"
>     formfields=" email, date_entered, time_entered, ip">
>
> <!--- retreive data --->
> <cfquery  name="tkt" datasource="Mysql" username="Myname"
> password="Mypass"
> >
> SELECT ticketid
> FROM resolve
> WHERE email = '#form.email#'
> AND time_entered = '#form.time_entered#'
> </cfquery>
>
> <!--- mail data --->
> <cfmail query="tkt"
>   from="[EMAIL PROTECTED]"
>   to="[EMAIL PROTECTED]"
>   subject="TICKET NUMBER #ticketID# New submission from website!"
> type="HTML">
> The follow message was posted through the website, <br>
> <br>
> Ticket Number: #tkt.ticketid#<br>
> <br>
> Sender email: #form.email#<br>
> Sender IP: #REMOTE_ADDR#<br>
> <br>
> Message Sent: #DateFormat(now(), 'mmmm dd, yyyy')#
> #TimeFormat(Now(),'hh:mm:ss tt')#<br>
> </cfmail>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to