Warning[] warnings; string[] streamids; string mimeType; string encoding; string extension; byte[] bytes =ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings); //converting into pdf MemoryStream s = new MemoryStream(bytes); //s.Seek(0, SeekOrigin.Begin); Attachment att = new Attachment(s, file); SmtpClient smtp = new SmtpClient("pod51014.outlook.com"); MailMessage msg = new MailMessage(); msg.Subject = "Invoice Report"; msg.From = new MailAddress ("209@dut4life.ac.za"); msg.To.Add(get_Email()); msg.Attachments.Add(att); smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.EnableSsl = true; smtp.Credentials = new System.Net.NetworkCredential("209@dut4life.ac.za", "Dut920925"); smtp.Port = 587; smtp.Send(msg);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)