I do that all the time. It's a very powerful method of emailing users
because it helps to spread the load out on both your mail server and
your CF server. Here's the code I use. User_newsletter_logs has two
fields: user_id, date_sent, first I load that table with the users I'm
sending the message to, then I run this code every X minutes with the
scheduler. select top 10 is a SQL 7 thing, not sure if it works in
Access or not.
<cfquery name="getxemails" datasource="#request.maindsn#">
select top 10 u.user_id,u.first_name,u.last_name,u.email, u.password
from users u,user_newsletter_logs unl
where unl.date_sent is null
and u.user_id=unl.user_id
</cfquery>
<cfloop query="getxemails">
<cfmail to="#email#" from="[EMAIL PROTECTED]" subject="The Fusebox
eBook is available!">
Dear #first_name# #last_name#,
blah blah blah
</cfmail>
<cfquery name="sentemails" datasource="#request.maindsn#">
update user_newsletter_logs
set date_sent=#now()#
where user_id=#user_id#
</cfquery>
</cfloop>
Steve Nelson
http://www.SecretAgents.com
Tools for Fusebox Developers
ryo watanabe wrote:
>
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_000D_01C044A2.2579BDA0
> Content-Type: text/plain;
> charset="Windows-1252"
> Content-Transfer-Encoding: quoted-printable
>
> Hi,
> I was wondering what would be the best way to send e-mail in a batch. =
> Say batch of 100 e-mail messages every hour. I am using a shared =
> hosting and do not have access to the mail server. I need to query a =
> database for the e-mail addresses that match a certain set of =
> requirements, and send e-mail to those addresses. There would be no =
> problem if there are less than 100 addresses, however, if there are 300, =
> I want to send those in 3 batches.
>
> The database is updated while sending e-mail, so query result must be =
> somehow kept track of...
> Any suggestions and/or ideas are welcomed.
> Thanks in advance.
>
> ryo
>
> ------=_NextPart_000_000D_01C044A2.2579BDA0
> Content-Type: text/html;
> charset="Windows-1252"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; =
> charset=3Dwindows-1252">
> <META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><FONT size=3D2>Hi,</FONT></DIV>
> <DIV><FONT size=3D2>I was wondering what would be the best way to send =
> e-mail in a=20
> batch. Say batch of 100 e-mail messages every hour. I am =
> using a=20
> shared hosting and do not have access to the mail server. I need =
> to=20
> query a database for the e-mail addresses that match a certain set =
> of=20
> requirements, and send e-mail to those addresses. There would be =
> no=20
> problem if there are less than 100 addresses, however, if there are 300, =
> I want=20
> to send those in 3 batches.</FONT></DIV>
> <DIV><FONT size=3D2></FONT> </DIV>
> <DIV><FONT size=3D2>The database is updated while sending e-mail, so =
> query result=20
> must be somehow kept track of...</FONT></DIV>
> <DIV><FONT size=3D2>Any suggestions and/or ideas are =
> welcomed.</FONT></DIV>
> <DIV><FONT size=3D2>Thanks in advance.</FONT></DIV>
> <DIV><FONT size=3D2></FONT> </DIV>
> <DIV><FONT size=3D2>ryo</FONT></DIV></BODY></HTML>
>
> ------=_NextPart_000_000D_01C044A2.2579BDA0--
>
>
>------------------------------------------------------------------------------------------------
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
>with 'unsubscribe' in the body to [EMAIL PROTECTED]
--
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]