Plesk Scheduler to run an .aspx file
Please follow the below steps, its working in windows shared hosting
Simple email scheduler
1. Go to Plesk control panel : Scheduled Tasks
2. Click Add New
3. Set the Parameters
Switched on: Give Check Mark
Description : Task name
Scheduler notification: Choose any one
Path to executable file * : C:\Windows\system32\cscript.exe
Arguments:C:\Inetpub\vhosts\Your_domain_name\httpdocs\test.vbs arg_1
Task priority: Normal
4. Click Run Now
test.vbs contains:
Call Schedule()
Sub Schedule()
On Error Resume Next
Dim objRequest
Dim URL
Set objRequest = CreateObject(“Microsoft.XMLHTTP”)
URL = “http://www.yourdomain.com/test.aspx”
objRequest.open “POST”, URL , false
objRequest.Send
Set objRequest = Nothing
End Sub
test.aspx Contains
<% @Page Language=”C#” %>
<% @Import Namespace=”System.Net” %>
<% @Import Namespace=”System.Net.Mail” %>
<%
string to = “email@skylarkhost.com”;
string From = “emailF@skylarkhost.com”;
string Sub = “SKYLARKHOST.COM”;
MailMessage m = new MailMessage();
m.From = new MailAddress(From);
m.To.Add(new MailAddress(to));
m.Subject = Sub;
m.Body = “How are you?”;
m.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient(“smtp server”, Give Port number);
smtp.Credentials = new NetworkCredential(From, “give smtp Password”);
smtp.EnableSsl = true;
smtp.Send(m);
m.Dispose();
%>