The web viewer can e-mail a rendered report from its toolbar. This example enables the button and handles the request in the page model.

Showing the button. Register an EmailReport action and enable the toolbar button:
@Html.StiNetCoreViewer(new StiNetCoreViewerOptions()
{
    Actions =
    {
        GetReport = "GetReport",
        EmailReport = "EmailReport",
        ViewerEvent = "ViewerEvent"
    },
    Toolbar = { ShowSendEmailButton = true }
})

Sending the message. The handler retrieves the prepared e-mail options and fills in your SMTP settings:
public IActionResult OnPostEmailReport()
{
    var options = StiNetCoreViewer.GetEmailOptions(this);
    options.AddressFrom = "admin@test.com";
    options.Host = "smtp.test.com";
    options.UserName = "admin@test.com";
    options.Password = "************";
    return StiNetCoreViewer.EmailReportResult(this, options);
}

The options returned by GetEmailOptions already contain the recipient, subject and the exported attachment; you supply the delivery details, and EmailReportResult sends the message.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.