<cfmail

Hi
Ive the below code and im trying to get it to check first that the confirmation field in the comments table is equal to 1 before it send

at the minute its sending anyway

any tips
Thanks

<cfquery name=“qgetdetails” datasource=“#test#”>
Select *
From comments
where confirmation = 1
</cfquery>

<cfmail to="Test@123.com"
bcc=“Test@123,Test@123”
from="Me@test.com"
subject=“Test”
>
Persons Name:#Name#
Persons Email:email#
Comments:#comments#
</cfmail>

Hiya,

The query you’re pulling in is filtering all those comments that are equal to 1. Is that not your check done there?

Only thing I can see missing is you’re not looping over the query to send out the individual emails.