public void CallConnection(string sender) { string To = ""; string Cc = ""; string BCc = ""; if (TxtTo.Text.Contains(',')) { To = TxtTo.Text.Replace(",", ";"); } else { To = TxtTo.Text; } if (TxtCc.Text.Contains(',')) { Cc = TxtCc.Text.Replace(",", ";"); } else { Cc = TxtCc.Text; } if (TxtBcc.Text.Contains(',')) { BCc = TxtBcc.Text.Replace(",", ";"); } else { BCc = TxtBcc.Text; } ClsSqlConnection obj = new ClsSqlConnection(); string mailid = ""; if (Session["ComeFrom"] != null) { if (Session["ComeFrom"].ToString() == "Drafts") { mailid = Session["DMaildId"].ToString(); } } DataSet ds = obj.Insert(TxtSubject.Text, txtBody.Text, "192.168.1.1", Session["CustomerId"].ToString(), To, Cc, BCc, "", sender, mailid); if (ds.Tables.Count > 0) { Session.Remove("DMaildId"); Session.Remove("ComeFrom"); } }