This example demonstrates how to email an exported Dashboard document (PDF in this example) with the MailKit cross-platform mail client library.
Handle the ViewerApiExtension.onDashboardTitleToolbarUpdated event to add a custom Email button to the Dashboard Title. Once a user clicks the button, an $.ajax POST request is sent to the server to pass the dashboard's ID and State from the client.
On the server side, the IndexModel.OnPostEmail method is called to accept the callback and its parameters. The DashboardExporter class instance exports a corresponding dashboard to a PDF document and sends it as an attachment along with the MimeMessage object from the MailKit library.
Note: The test Ethereal Email SMTP server is used in this example. You can replace the authentication parameters passed to the SmtpClient.Connect and SmtpClient.Authenticate methods with parameters that correspond to your email server.
- Dashboard for MVC - How to implement server-side export
- BI Dashboard - How to Use MailKit to Send a Dashboard as a Document in PDF
- BI Dashboard - How to Email a Dashboard that Displays Different Data Depending on the Addressee
(you will be redirected to DevExpress.com to submit your response)