MessageTry Scoping your variables and I'd be inclined towards avoiding
cfmail inside cfoutput. Ermm - I'm lazy so I can't be bothered testing it...
but I'd suspect the following would be a go.

Oh, and ensure that ##'s are closed and '' pairs are completed... And
probably look at refining your query so that only the required variables are
returned. select * is the cousin of the source of all evil.

<cfif #variables.assigned_to#='2'>
<cfset variables.person='username'>

<cfif #variables.person#='Joe Blow'>
<cfset #variables.email#='[EMAIL PROTECTED]'>

<cfmail
 From="[EMAIL PROTECTED]"
 Subject="Task is overdue"
 To=#variables.email#>
 The task ID is: #latetasks.task_id#
 The task description is: #latetasks.description#
 The task was due for completion on
#DateFormat(latetasks.scheduled_completion, "D MMMM YYYY")#
 Please visit www.cleverthinking.com.au to update your task.
</cfmail>


----- Original Message -----
From: Dean Brandt
To: CFAussie Mailing List
Sent: Wednesday, March 05, 2003 11:27 AM
Subject: [cfaussie] Missing a loop somewhere



    Hi all

    I am trying to send an email to the assigned person in a task list using
this code:


<cfoutput query="latetasks">
<cfmail
 From="[EMAIL PROTECTED]"
 Subject="Task is overdue"
 To=#email#>
 The task ID is: #task_id#
 The task description is: #description#
 The task was due for completion on #DateFormat(scheduled_completion, "D
MMMM YYYY")#
 Please visit www.cleverthinking.com.au to update your task.
</cfmail>
</cfoutput>


    What is happening is that it sends all emails to one person rather than
sending each item to its owner.

    #email# is defined by a cfset earlier in the code. ie if a task is
assigned to id number 2:

<cfif #assigned_to#='2>
<cfset person='username'>

then

<cfif #person='Joe Blow>
<cfset #email#='[EMAIL PROTECTED]'>


    Can anyone see any glaring faults with this? Obviously there's at least
one :)

    Thanks

Dean Brandt
Clever Thinking Consulting
Network/Systems Integration,
Application Design
Melbourne, Australia
0418488885
...smart networks for smart business


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to