Hey All,
Can someone point me in the direction of an online tutorial for what I am trying to accomplish.
I need to send out some mass emails on a nightly basis to people who have signed up for courses on our website as a reminder for upcoming courses.
I have built the application so that it works fine when I actually run an ASPX page and press a button.
Now I want to run the same code everynight at 1am automatically, by the way this is running on WebHost4Life shared hosting package so I can not interact with the server directly.
2nd part of the question, where besides the database is a good spot to store a single peice of data and access it. The above mentioned app sometimes will require being filtered by CategoryID in the SQL statement. So I created the proper SQL to Filter by a LIKE statement.
So the odd night I may have to insert a Category, but for the most part it will run against all Categories and not filter. So I have one single value that I would like to be able to edit and store somewhere but not create an entire DB table just to store one single value.
Any help would be great!
Thank,
switch to php and use cronjob
lol
Do you have access to SQL server?
if yes, create a triger on one of your table, that would execute a DLL. SQL2005 is great for that.
CREATE ASSEMBLY Users
FROM 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\Test\CLRProcedures\CS\Users.dll'
with Permission_set= UNSAFE
CREATE TRIGGER InsertTrigger
ON TQADSend
FOR INSERT
AS
EXTERNAL NAME
Users.Users.InsertTrigger
Here's what I would do:
1) get rid of the button so that the deal runs when the page is simply requested.
2) In your Application_Start event in global.asax, check a value in the database to see the last time the email "job" was run (you'll need to update that value in the database right after it runs)
3) if its XX number of hours or greater since, create a WebClient class instance and request the page - which will run your job.
4) update your database with the datetime.
Applications normally recycle several times a day at the least, so that should take care of it.
create an application that can process your recipients and sent out mail and call it from a scheduled task
0 comments:
Post a Comment