or



01.Private Sub RadGrid1_GridExporting(sender As Object, e As GridExportingArgs) Handles RadGrid1.GridExporting02. 03. If isLoc <> True Then04. 05. Dim ms As New MemoryStream(New UTF8Encoding().GetBytes(e.ExportOutput))06. 07. Dim smtpClient As New SmtpClient()08. smtpClient.EnableSsl = True09. 10. Dim mailMessage As New MailMessage()11. mailMessage.IsBodyHtml = True12. mailMessage.[To].Add(New MailAddress(Session("Email")))13. mailMessage.Subject = "Reporting service - Do Not reply"14. mailMessage.Body = "This report was sent from <br /><b>Reporting service</b> "15. mailMessage.Attachments.Add(New Attachment(ms, "Reporting service" & DocType))16. Try17. smtpClient.Send(mailMessage)18. 'Label1.Text = "Message Sent" 19. MsgBox("Message Sent")20. Catch ex As Exception21. 'Label1.Text = ex.ToString()22. MsgBox("Message not Sent")23. End Try24. 25. Response.Redirect(Request.Url.ToString())26. 27. 28. 29. End If30.End Sub