Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what's wrong with this little script??

Status
Not open for further replies.

snix1

Programmer
Dec 12, 2000
107
US
We are running CF 4.5 with SQL Server. When I run the following script, I get multiple (identical) e-mails, many with the same subject. Is there anything wrong with my script? Is there a problem using <cfmail> within a <cfloop>?

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>

<html>
<head>
<title>Untitled</title>
</head>

<body>

<cfoutput>doing the loop<br></cfoutput>
<cfloop index=&quot;counter&quot; from=&quot;1&quot; to=&quot;10&quot;>
<cfmail to=&quot;snix@fallcomm.com&quot;
from=&quot;ceser@icesa.org&quot;
subject=&quot;TEST MESSAGE and counter=#counter#&quot;>
This is a test message.
</cfmail>
</cfloop>
</body>
</html>


Thanks much for your help!
 
It appears the loop is sending the email 10 times, remove it
from the loop.

Dave
 
Thanks for the input. I get over 100 e-mails from this thread! I know I should get 10.
 
snix1, You're getting lots of email, but you're saying you're not getting exactly 10, and their subjects aren't unique .. 1 2 3 ... 10 ?

Is that right?
 
I'm confused...
I cut and pasted the above code and saved it to a file, ran it, and got 10 emails, each with a unique subject (...1,...2,...3, etc.)

are you not getting the same results?

-Marc
 
Thanks to everyone for responding. I spoke with Allaire and this is a bug...we need to install a service pack which will be done next week.
Susan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top