Hi,

I'm selecting email addresses to mail where the field emailsent is null. After I run the cfmail, I update the field to the date the email was sent.

Is there a danger of the update query running before the cfmail is finished? Is there a solution for this?

Many thanks!

Well if I recall typical sysadmin settings for coldfusion, cfmail messages will be sent when the coldfusion feels like it (this annoys me to no end). You can override this by adding an extra attribute to your cfmail tag. Here is an example of its use:

<cfmail from="info@test.com" to="someguy@wherever.com" subject="mysubject" spoolenable="false">
#myMessage#
</cfmail>

This tells coldfusion to send the e-mail immediately.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.