- Feb 13, 2003
- 26,256
- 406
- 126
I'm working on an application that sends out a "Question of the Day" sort of thing to a group of users. A web application exists so users can submit questions and days to send them out, and a Windows Service runs every 15 minutes to see if there's any to be sent out; if so it gets the list of users to send to and runs a loop to send them out to each user as they must be personalized for each user to include that user's username.
That's the whole thing in a nutshell, but the problem lies in the fact that the recipient pool could grow to include a thousand or more recipients, and I don't think the server will be able to handle that (using .NET and the SmtpClient to send them out in a loop on each user's record).
So, it was suggested to send out the emails according to each user's local time, at 8 am. If a user is EST time zone (GMT - 5), and the server is also EST, when the timer goes off on the Windows Service at say 8:15 am, then that user's email should be sent out. However, even though the same question was scheduled to be sent to a user in GMT - 0, it should not be sent out until 5 hours from now.
Currently we do not store a user's time zone, and I think that would be the first step here. But beyond that, I'm having some trouble wrapping my head around how the Service should wait until GMT - 0 to send out that second email. I should also mention that a log table is kept and after each successful email is sent, a record is written there so the Service can pick back up after an error or crash.
If anyone has any ideas at all that could point me in the right direction it would be greatly appreciated.
That's the whole thing in a nutshell, but the problem lies in the fact that the recipient pool could grow to include a thousand or more recipients, and I don't think the server will be able to handle that (using .NET and the SmtpClient to send them out in a loop on each user's record).
So, it was suggested to send out the emails according to each user's local time, at 8 am. If a user is EST time zone (GMT - 5), and the server is also EST, when the timer goes off on the Windows Service at say 8:15 am, then that user's email should be sent out. However, even though the same question was scheduled to be sent to a user in GMT - 0, it should not be sent out until 5 hours from now.
Currently we do not store a user's time zone, and I think that would be the first step here. But beyond that, I'm having some trouble wrapping my head around how the Service should wait until GMT - 0 to send out that second email. I should also mention that a log table is kept and after each successful email is sent, a record is written there so the Service can pick back up after an error or crash.
If anyone has any ideas at all that could point me in the right direction it would be greatly appreciated.
