Vigna Hari Karthik
Vigna Hari Karthik

Reputation: 109

Automate the .aspx through windows task scheduler in server

I have an .aspx in that it will send email to the employees. I want this page should be automatically send to employees everyday. So i have published in IIS and created an windows task scheduler in the server "C:\Program Files\Internet Explorer\IEXPLORE.EXE""http://syspexsap03/AUTOEMAIL/Default.aspx" It works fine "if the operations runs successfully" i receive email after that still IE is working in the background apps in server.so immediately it cannot run the next task..It works locally.In case of server when i deploy no use. I have used this codes to kill the process:

Process[] AllProcesses = Process.GetProcesses();
                foreach (var process in AllProcesses)
                {
                    if (process.MainWindowTitle != "")
                    {
                        string s = process.ProcessName.ToLower();
                        if (s == "iexplore" || s == "iexplorer")
                            process.Kill();
                    }
                }

and tried to do with the process id no use every time it generate new Pid:

            Process p = Process.GetProcessById(15844);
            p.Kill();
            Process p1 = Process.GetProcessById(13380);
            p1.Kill();
            Process p2 = Process.GetProcessById(196);
            p2.Kill();

How to schedule the aspx page in the windows task scheduler and kill the IE at the same time to run the next task ? Should run everyday on a specified time.. Please guide me..

Upvotes: 0

Views: 980

Answers (1)

Gurneet
Gurneet

Reputation: 41

In order to make an activity which runs at a particular schedule you don't need an aspx page or web application and publish in IIS for it. It should be a console application where the .exe file can be scheduled in the window task scheduler at a particular time.Task Scheduler runs ordinary EXEs.

Also if you are sending email to employees which belong to same domain then there is no limitation on mails per day. But if the email are not of the same domain then there is an limitation. Link below in order to check the limitation

http://group-mail.com/sending-email/email-send-limits-and-options/

Upvotes: 1

Related Questions