Aarif Ansari

Aarif Ansari

  • NA
  • 76
  • 2.9k

How to fire scheduler using C# based on Event table in DB?

Feb 16 2018 1:30 AM
Please explain this how to solve this issue.
 
This is my code: --
 
public class Job : IJob
{
public void SendSMS()
{
var Message = "Server Response " + new SmsProcessor().SendSMS("918800604269", "hi this is test SMS API by MVC 02-01-2018", SmsProcessor.SmsType.SendSMS_MType);
using (var message = new MailMessage("[email protected]", "[email protected]"))
{
message.Subject = "Message Subject test";
message.Body = "Message body test at " + DateTime.Now;
using (SmtpClient client = new SmtpClient
{
EnableSsl = true,
Host = "smtp.gmail.com",
Port = 587,
Credentials = new NetworkCredential("[email protected]", "7838279575")
})
{
client.Send(message);
}
}
}
public static bool IsTaskDone = false;
public void Execute(IJobExecutionContext context)
{
SendSMS();
}
}

Answers (1)