public void SenEmail(string EmailAddress) { if (EmailAddress != "") { try { url = "http://www.mednob.com/new/unsubscirbe.aspx?email_id=" + EmailAddress; // Mail Using Domain MailMessage mM = new MailMessage(); //mM.From = new MailAddress("tradelink@mednob.in", "Mednob"); mM.From = new MailAddress("kumar@availtechnologies.net", "Mednob"); //mM.From = new MailAddress("info@mednob.com", "Mednob"); mM.To.Add(new MailAddress(EmailAddress)); mM.Subject = txtSubject.Text; mM.Body = ConvertToHtmlFile(filename, url); mM.IsBodyHtml = true; mM.IsBodyHtml = true; mM.Priority = MailPriority.High; SmtpClient sC = new SmtpClient("webmail.markersspot.com"); sC.Port = 25; // sC.Credentials = new System.Net.NetworkCredential("mail@availtechnologies.net", "Avail12345"); sC.Credentials = new System.Net.NetworkCredential("kumar@availtechnologies.net", "seetha07"); //sC.EnableSsl = true; sC.Send(mM); } catch (Exception ex) { if (con.State == ConnectionState.Closed) { con.Open(); } SqlCommand cmd1 = new SqlCommand("update tbl_sendmail set status=0 where recipient='" + EmailAddress + "'", con); int a = cmd1.ExecuteNonQuery(); if (con.State == ConnectionState.Open) { con.Close(); } wrongmail++; // Response.Write(ex.ToString()); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)