Forum Moderators: open

Message Too Old, No Replies

Sending out newsletters

         

webboy1

7:20 pm on Feb 25, 2003 (gmt 0)

10+ Year Member



Hi,

I am currently sending out over 11,000 news letters through loop on a database. The script works fine, this, and most other, mail servers probably do not want 11,000 emails sent through it at once. So i opted to send in batches of 400-500 and then waiting 5-10mins to give the mail server time to clear, then sending another 400-500 and so on etc

This is obviously not very practical....because it is taking me a good few hours+ to do it. Is there any function i can add into my could that will delay the script.

i.e. If i set the script up to send to all whose id is between 1 and 400, then, once the loop is complete a delay function would kick in for 5 mins, then the next part of the script would run, which would be the same as the first, only to users with id between 400 and 800.

Anyone any ideas?

Regards
Webboy

graywolf

7:28 pm on Feb 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I would write a vbscript that would select the number of letters you wish to send per time period. Then use the scheduler to rerun the script at whatever time interval you wanted to send the next batch. You would have to keep a crossrefrence table to keep track of who you already sent it to, so you wouldn't send it more than once.

ziggystardust

12:57 pm on Feb 28, 2003 (gmt 0)

10+ Year Member



yup, a scheduled script would probably be the best solution. With a script that waits automatically, you need to set a very high script timeout, and if something goes wrong along the way, you'd have to run it all over again (or rewrite part of the code).

webboy1

1:36 pm on Feb 28, 2003 (gmt 0)

10+ Year Member



Do Either of you have any hints as to how i write a scheduling script?

Webboy

ziggystardust

5:54 pm on Feb 28, 2003 (gmt 0)

10+ Year Member



you could use the "scheduled tasks" programme, included in Windows, to set the script to run every five minutes.

start - programs - accessories - system tools - scheduled tasks

pearl

6:08 pm on Feb 28, 2003 (gmt 0)

10+ Year Member



I found this:

On Error
Resume Next
Dim StartTime As
Single
Dim StopTime As Single


StartTime = Timer
DoEvents


'Deal with timer starting over at Midnight
If Delayseconds > 0 Then

If StartTime + Delayseconds < 86400
Then
StopTime = StartTime + Delayseconds
Else
StopTime = (StartTime - 86400) + Delayseconds

End If
End If

Do Until
Timer >= StopTime
DoEvents

Loop

chris_f

10:14 am on Mar 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



webboy1,

Check you Sticky.

Chris