This is because the <cfmail> tag uses the <cfoutput> mechanism internally ( this is why it has the query="" atrribute and I think a group="" attribute... this is also why you don't need a <cfoutput> inside a <cfmail> in order to output variables, because the folks at Allaire originally assumed people would want to do that most of the time ( probably a good assumption :)
In any event -- You probably don't want a <cfoutput> or even a <cfloop> here anyway -- since the query is designed to return what I can only imagine has to be a single row ( the given user ), what you probably want to do is just have your <cfif> statement evaluate name.recordcount ( though I'd rename that query also ) and send the email if query.recordcount is greater than zero. No need for a <cfoutput> there, since <cfmail> essentially _is_ a <cfoutput> ... hth S. Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 > Dave, > It really doesn't make any sense but it works. I'm sure as I work with it > more it will sink in. Thx. > ummm ... Is this because <cfoutput query=""> loops through the table? ... > and this makes it stop at the first match? > // glm > -----Original Message----- > From: Dave Wilson [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 01, 2002 9:57 AM > To: CF-Talk > Subject: RE: embedding cfmail in a cfoutput > Do a group on the user id. This way your grouping is done on individual > unique values, hence cancelling out the grouping. > Hope this makes sense, > Dave > -----Original Message----- > From: Gilbert Midonnet [mailto:[EMAIL PROTECTED]] > Sent: 01 October 2002 14:54 > To: CF-Talk > Subject: embedding cfmail in a cfoutput > I must be missing something very simple. I'm trying to embed a cfmail in a > cfoutput tag and am getting the following error msg. > // ERROR MSG > A CFMAIL tag is nested inside a CFOUTPUT tag that does not have a GROUP= > attribute. This is not allowed. Nesting these tags implies that you want > to > use grouped processing. However, the top-level tag must specify a > top-level > group using a GROUP= attribute. > // END of ERROR MSG > As I understand it I have no need of a group attribute; nor would the > group > attribute help in this situation. Of course it may be that my > understanding > is incorrect. :-] > PROBLEM: > Users fill in a form. They are in a permissioned area. They authenticate > their submission by filling in their user username and password. (To be > doubly sure that the submitter is the person logged into the site.) > The processing page queries the database and sees if the username and > password equals the form submitted username and password. If it is a > cfmail > is sent. If not then an error msg appears. > code below: > <cfquery name="name" datasource="aaa"> > SELECT * > FROM users > WHERE Username='#log_username#' > </cfquery> > <cfoutput query="name"> > <cfif #username# EQ #form.submittedUsername# AND #password# > EQ #form.submittedPassword#> > <cfmail > to="" > from="" > subject="" > > > yadda yadda yadda > </cfmail> > <cfelse> > Your username and password do not match the login > records of the current user. > </cfif> > </cfoutput> > thx, > gilbert midonnet > ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

