Project Menu Add Reference System .wed (this is required for Mail Message class) Place Timer (System .Timers )control Properties Enabled = true Interval = 60, 000 Interval 100ms w:30 12:30:00 01 1 sec = 600 .. 100ms = 60 … 1 60,000 59 60,000
Using System. web. Mail;
Code for Timer 1 _ Elapsed Event
{
Int sh =Date Time . Now. Hour ;
// 24 hrs format
Int sum = Date Time . Now. Minute;
If (sh == 12 && sm ==30)
{
Mail Message m = new Mail Message ();
M .to = “teja @ yahoo.com”; m.cc = “varoon @india.com”;
subject = “Happy Pongal”;
body Format = Mail Format. Html;
body = <h1>Happy pongal </h1> <hr>
<h2><Font color = Green> Dear Friends, This is to inform you that, our next class will be on 17th jan, 2009 </Font> </h2>”;
Form = “Prakash @ptpl”;
//ptpl is computer name Smtp Mail .Send (m);
}
// if
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.