Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim rptDocument As ReportDocument = New ReportDocument()
- rptDocument.Load(mReportPath)
- Dim exportOpts As ExportOptions = New ExportOptions()
- Dim pdfOpts As PdfRtfWordFormatOptions = ExportOptions.CreatePdfRtfWordFormatOptions()
- exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
- exportOpts.ExportFormatOptions = pdfOpts
- rptDocument.ExportToHttpResponse(exportOpts, Response, True, "")
- Dim msg As New MailMessage()
- msg.From = New MailAddress("proccoinvoice@gmail.com")
- msg.[To].Add(recipient)
- msg.Subject = "Procco Invoice"
- msg.Body = "Invoice attached"
- msg.Attachments.Add(New Attachment(filepath)) //Path should be given here
- Dim client As New SmtpClient("smtp.gmail.com")
- client.Port = 25
- client.Credentials = New NetworkCredential("proccoinvoice@gmail.com", "<Procco>;1947")
- client.EnableSsl = True
- client.Send(msg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement