Send mail automatically from ASP.NEt [modified]
-
I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand -
I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn RandTwo options are 1 - Windows services 2 - A windows application runs on background and giving request to a web service which sends mail
-
I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn RandRohde wrote:
I guess the only way to do that is to have a Windows Service right?
I guess there is one more way to do this. You can schedule a job on the database-side using SQL Server Agent which will wake up every morning and do the task.
Rohde wrote:
I've tried to persuade the powers in be that the easiest way is for somebody to click a button every Monday morning to start the procedure
Triggering a procedure from the application side on the button click event to perform a scheduled task is not a good practice. What if the person forget's to do his task... Yes, you can write a windows service to perform this task...
Regards
- J O N -
-
I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn RandYou can also use the database directly to send the emails. for this create a strored procedure and scheduled a job in the database then will run automatically after the specified time.
Pankaj Gupta (Take it easy)
-
You can also use the database directly to send the emails. for this create a strored procedure and scheduled a job in the database then will run automatically after the specified time.
Pankaj Gupta (Take it easy)
Yes I know, but we're using MySQL v5.0 and events are in v5.1 which at the moment is a release candidate.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand -
Rohde wrote:
I guess the only way to do that is to have a Windows Service right?
I guess there is one more way to do this. You can schedule a job on the database-side using SQL Server Agent which will wake up every morning and do the task.
Rohde wrote:
I've tried to persuade the powers in be that the easiest way is for somebody to click a button every Monday morning to start the procedure
Triggering a procedure from the application side on the button click event to perform a scheduled task is not a good practice. What if the person forget's to do his task... Yes, you can write a windows service to perform this task...
Regards
- J O N -
John Prabhu wrote:
I guess there is one more way to do this. You can schedule a job on the database-side using SQL Server Agent which will wake up every morning and do the task.
Yes I know, but our current RDBMS doesn't have that functionality, MySQL v5.0, but events will debut in MySQL 5.1 so perhaps we will look at if and when we upgrade.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand -
I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn RandRohde wrote:
I need to send mails automatically once a week from an ASP.NET app based on some information stored in the database. I guess the only way to do that is to have a Windows Service right?
Basically what J4amieC said, which is: 1- Create a small windows app that simply calls the ASP.NET page. 2- Schedule a windows task to call that EXE once a week. 3- Send the email through the ASP.NET page in question. Of course the whole thing would have been easier if you could run cron jobs on windows. :laugh:
Pete Soheil DigiOz Multimedia http://www.digioz.com