Create the document in memory in .NET 6.0 and send it as an e-mail attachment without leaving a temporary file.

Showing the send-email button. Enable the toolbar button in the viewer options during initialization:
var options = new StiAngularViewerOptions();
options.Toolbar.ShowSendEmailButton = true;
return StiAngularViewer.ViewerDataResult(requestParams, options);

Handling the send request. When the user sends a report, the viewer calls the EmailReport action. Retrieve the prepared e-mail options and fill in the SMTP settings of your mail server:
[HttpPost]
public IActionResult EmailReport()
{
    StiEmailOptions options = StiAngularViewer.GetEmailOptions(this);

    // Recipient, subject and body come from the viewer and can be adjusted here
    // options.AddressTo = "";
    // options.Subject = "";

    // Your mail server settings
    options.AddressFrom = "admin_address@test.com";
    options.Host = "smtp.test.com";
    options.Port = 465;
    options.UserName = "admin_address@test.com";
    options.Password = "admin_password";

    return StiAngularViewer.EmailReportResult(this, options);
}

The StiEmailOptions object returned by GetEmailOptions already holds the recipient, subject and the exported attachment prepared by the viewer; you only supply the server-side delivery details. EmailReportResult then sends the message and reports the result back to the viewer.

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