CronicColin
New Member
my project is send mail automatically without button click when system(voice logger) failed..i need code for that with if condition..\[code\] protected void Button1_Click(object sender, EventArgs e) { MailMessage msg = new MailMessage(); msg.From = new MailAddress("[email protected]"); msg.To.Add("[email protected]"); msg.To.Add("[email protected]"); msg.Body = "Testing the automatic mail"; msg.IsBodyHtml = true; msg.Subject = "Movie Data"; SmtpClient smt = new SmtpClient("smtp.gmail.com"); smt.Port = 587; smt.Credentials = newNetworkCredential("[email protected]","********"); smt.EnableSsl = true; smt.Send(msg); DateTime current_time = DateTime.Now; current_time = current_time.AddSeconds(1); Thread.Sleep(10000); if (current_time == DateTime.Now) { bw.RunWorkerAsync(); } Response.Write("Success"); }\[/code\]