ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 1st, 2004, 02:04 PM
rotadog rotadog is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 rotadog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sending mail in batches with CFMAIL...need some help

I need to find a way to send email in batches of say 200 at a time with the CFMAIL tag.

Here's why:

I have created a newsletter app that uses CFMAIL to send to subscribed users I have in a DB. Everything works great except that my hosting provider's mail server will not allow me to send more than 250 mails at a time and there are a total of 1600 addys in the list.

Is there any way to create some sort of a loop that will:

a. Send out an email to 200 subscribers in the list
b. Wait for a specified amount of time
c. Send out another 200 emails in the list where it last left off...... and so on until the mailing is complete.
d. Can this be performed in the background using CFSCHEDULE?

Any help will be appreciated, even it is just pointing me in the right direction....

Cheers!

Reply With Quote
  #2  
Old July 1st, 2004, 02:29 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 25 m 55 sec
Reputation Power: 53
You have a few options. You can feed a query result set into CFMAIL, and you could just limit the query to 200 records at a time. You'd just have to keep track of where the last query left off so you can get the next 200 records (could be persisted as an application variable perhaps, or stored in a temporary database table). Or you could set a flag in the database to note that a record was emailed. Then after all the emailing is done and all the flags are true, you could go through and reset them all to false in preparation for the next mail run (whenever that might be).

There's no way to tell CF to wait a specified amount of time, but you could set up a scheduled task that starts and does the first 200, then 15 minutes later does the second 200, etc...

Hope that helps.

Brian
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old July 1st, 2004, 02:50 PM
rotadog rotadog is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 rotadog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the tip kiteless.

I'm gonna give it a shot and look more into the CFSCHEDULE tag. I've never used it before so I should be able to learn a quite a bit at the same time.

I'll post what I come up with so hopefully I can help other people with the same problem.

Thanks again

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Sending mail in batches with CFMAIL...need some help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT