|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Sending mail in batches with CFMAIL...need some help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|