void mailsend() { while (true) { try { i = 1; if ((DateTime.Now.Hour == 13) && (DateTime.Now.Minute == 00) && (DateTime.Now.Second == 00)) { mailtosend.To.Add(names[0]); while (names[i]!=null) { //mailtosend.To.Add(names[i]); mailtosend.Bcc.Add(names[i]); i++; } //Response.Write("The id added " +mailtosend); mailtosend.From = new MailAddress("reports@cutchsoft.com"); mailtosend.Subject = "Cutch Tele Login Reports as of " + yesterday; mailtosend.IsBodyHtml = true; mailtosend.Body = htmlbody; SmtpClient sc = new SmtpClient(); sc.Host = "mail.cutchsoft.com"; sc.Credentials = new System.Net.NetworkCredential("reports@cutchsoft.com", "reports"); sc.Send(mailtosend); } }//if check catch (Exception ee) { //ClientScript.RegisterStartupScript(this.GetType(), "a", ""); } }//while }//mail send fun
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)