Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- StringBuilder sb = new StringBuilder();
- string MailSturcture;
- using (System.IO.StringWriter sw = new StringWriter())
- {
- using (HtmlTextWriter hw = new HtmlTextWriter(sw))
- {
- gvDaySummary.RenderControl(hw);
- hw.WriteBreak();
- BarChart1.RenderControl(hw);
- System.IO.StringReader sr = new StringReader(sw.ToString());
- MailMessage mail = new MailMessage();
- mail.From = new MailAddress("noreply@xxx.com", "aura");
- mail.To.Add("abc@xxx.com");
- mail.Subject = "Daily Payment Summary";
- mail.IsBodyHtml = true;
- sb.AppendFormat(sw.ToString());
- MailSturcture = sb.ToString();
- mail.Body = MailSturcture;
- System.Net.Mail.SmtpClient smtp = new SmtpClient();
- smtp.Host = "smtpout.secureserver.net";
- smtp.Port = 80;
- System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
- NetworkCred.UserName = "abc@xxx.com";
- NetworkCred.Password = "xxx";
- smtp.UseDefaultCredentials = true;
- smtp.Credentials = NetworkCred;
- smtp.EnableSsl = false;
- smtp.Send(mail);
- }
- }
- public override void VerifyRenderingInServerForm(System.Web.UI.Control control)
- {
- /* Verifies that the control is rendered */
- }
- Script control 'BarChart1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
- Parameter name: scriptControl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement