Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Dim rptDocument As ReportDocument = New ReportDocument()
  2. rptDocument.Load(mReportPath)
  3. Dim exportOpts As ExportOptions = New ExportOptions()
  4. Dim pdfOpts As PdfRtfWordFormatOptions = ExportOptions.CreatePdfRtfWordFormatOptions()
  5. exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
  6. exportOpts.ExportFormatOptions = pdfOpts
  7. rptDocument.ExportToHttpResponse(exportOpts, Response, True, "")
  8.  
  9. Dim msg As New MailMessage()
  10. msg.From = New MailAddress("proccoinvoice@gmail.com")
  11. msg.[To].Add(recipient)
  12. msg.Subject = "Procco Invoice"
  13. msg.Body = "Invoice attached"
  14. msg.Attachments.Add(New Attachment(filepath)) //Path should be given here
  15. Dim client As New SmtpClient("smtp.gmail.com")
  16. client.Port = 25
  17. client.Credentials = New NetworkCredential("proccoinvoice@gmail.com", "<Procco>;1947")
  18. client.EnableSsl = True
  19. client.Send(msg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement