i just had to comment that this is the coolest simplest idea for a problem
i've been thinking about for a while.
the bulk of the email i send out is "here's what's new in the last x days".
so if anyone has a similar problem here's how i plan to do it, hopefully
this will help you.
in my user table i'll add a date field called lastNewsletter
i'll select top 10 of users where lastNewsletter > now()-x days
generate and cache the "what's new part", the code that updates stuff on my
site delete appropiate cached files so they will be regenerated next time
send out mail with cached or just cached content.
i figure i could run this with every hit (since i can't use cfschedule),
most of the time it wouldn't send out any email, but when it does, it'll
only send out 10 with cached copy so it won't slow down the request too
much. i'll tweak how many i send out based on how much i see it slows down
requests.
it's just beautiful i tell ya... beautiful.
---
defective david
http://defective.net
----- Original Message -----
From: "Steve Nelson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, November 02, 2000 7:49 AM
Subject: Re: Sending e-mail in a batch
> I usually just do a calculation to determine that. Figure out how long
> you want the email to span over. 1 hour? 1 day? 1 week? etc. Then
> divide that by the number of emails that need to go out and you'll be
> able to figure out how many to send.
>
> This depends on how much load you think your server will be hit by. For
> example, when we released the ebook for my fusebox book, I was a little
> concerned that if there was a rush to download it my server would crash
> from the gigs of download. So I emailed a handful of people every 5
> minutes for 24 hours. That way they would span out the downloads.
>
> It worked like a charm!
>
> Steve
>
> ryo watanabe wrote:
> >
> > Thanks for the help!
> > What would you suggest for the numbers of messages and the interval?
> >
> > ryo
> > ----- Original Message -----
> > From: "Steve Nelson" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Thursday, November 02, 2000 8:46 AM
> > Subject: Re: Sending e-mail in a batch
> >
> > > 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]
> > >
> >
>
> --------------------------------------------------------------------------
----------------------
> > 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]
>
> --
> Steve Nelson
> http://www.SecretAgents.com
> Tools for Fusebox Developers
> --------------------------------------------------------------------------
----------------------
> 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]
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists