Skip to content

DevExpress-Examples/asp-net-core-dashboard-mailkit-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dashboard for ASP.NET Core - How to Use MailKit to Send a Dashboard as a Document in PDF

This example demonstrates how to email an exported Dashboard document (PDF in this example) with the MailKit cross-platform mail client library.

Exported Dashboard

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.

Files to Review

Documentation

More Examples