Friday, May 20, 2005

I Need An Auto Email Responder In Coldfusion

I am developing a email-based friends network management project with Coldfusion. I am sending periodic emails to the members according to particular time or date. So I need some kind of periodically executing code snippet.

Here you go:

<cfquery name="qryUsers" datasource="#DSN#">
SELECT *
FROM Users
WHERE datefield IS BETWEEN '2005-06-10' AND '2005-06-11'
</cfquery>

<cfloop query="qryUsers">
<cfmail to="#qryUsers.email#" bcc="youremail@yourhost.com" server="mail.yourhost.com" from="youremail@yourhost.com" subject="Email Subject" type="HTML">
<pre>
Hello #Fname# #Lname#,

How are you today?
</pre>
</cfmail>
</cfloop>

0 Comments:

Post a Comment

<< Home