简体   繁体   中英

How to send a mail every 5 mins using schedulers in asp.net (without using window service)?

Hi I want to send a mail every 5 mins using schedulers in c#,but I don't want to use windows service.how to send a mail every 5 minits. pleae anyone help me.

We obviously are not going to write code for you, but please have a look at this suggestion:

  • Write your Console Application that sends Emails.
  • For this have a look at the classes SmtpClient and MailMessage
  • You can also configure Log4Net with an EmailAppender to send Mails

  • Schedule a Task in "Windows Scheduler" to call the Console App every 5 minutes

You can write a simple console application which get's started by the windows task scheduler every 5 minutes. This would be the simplest and most stable way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM