I get no errors in my code and would think the problem lies in the code below. Can anyone help me or suggest a better solution?
I am testing it on my computer with XP Professional and using the virtual SMTP on IIS, but it is going to be installed on a 2003 Server later. Does this make any difference?
public
partial class mailTimer : ServiceBase{ private mailJob job;private Timer stateTimer;
private TimerCallback timerDelegate; public mailTimer(){
ServiceName =
"Mail Service";CanStop = true;
CanPauseAndContinue = false;
AutoLog = true;
} protected override void OnStart(string[] args){
job =
new mailJob();timerDelegate = new TimerCallback(job.doSomething);
stateTimer = new Timer(timerDelegate, null, 30000, 30000);
} protected override void OnStop(){
stateTimer.Dispose();
}
}
Thanks for any help!
Erik PetersenPosted Jun 8, 2006, 9:05 AM
Have now tried it on the Server 2003 and it works fine. Do not know why it does not work on my machine, but the important thing is that it works on the server.
/Erik