views:

18

answers:

1

I have a website and would like to send out emails regularly one or twice a week.

One method I know of sending a email say every thursday at 5:30pm would be to have a windows service start up at the correct time and open a webpage of my website. This page would be a hidden page which then would make all the emails and send them out!

This is a bit of a dirty way to do things but it does mean I simply just have to create a new page in my website and not do alot more...

Is their a better way to do this? I could make a stand alone application/cmd line program which connects to the database and does the same but this would require more work with setting up the connection to the database and more..

Whats everyones opinions on possible methods to do this task?

+2  A: 

From a security standpoint and for other reasons I would recommend offloading this to a windows service or a .NET app that you schedule via Task Scheduler as in the end it is going to give you more flexibility, stability, and security over the alternative. Just to give you a few reasons.

  1. No timeouts to worry about if your site grows and the e-mail processing takes more time than expected.

  2. No need to publicly expose an email blast trigger where a malicious user could try to send e-mails when not needed.

  3. You separate the e-mailing functionality out into its own component that can run on its own, that way if you need more functionality it will be easier to extend later

Mitchel Sellers
fair points.. is it possible to keep it inside the same vs solution? (ive never done something quite like this) as this would give me nice access to the data access layer
Steve
Sure can! Just right click on the solution, select "Add New Project", and you are set to go!
Mitchel Sellers