Sending a Report by Email
Our sample projects and report templates can help you learn the basics of working with our products.A report can be exported in memory and sent as an e-mail attachment — the SMTP settings stay on the server, never reaching the client.
Configure sending in the email event.
How it works. The document is built and mailed server-side, so recipients get the attachment while the mail credentials stay private.
Configure sending in the email event.
def emailReport(args: StiEmailEventArgs):
args.settings.fromAddr = 'mail.sender@stimulsoft.com'
args.settings.host = 'smtp.stimulsoft.com'
args.settings.port = 456
args.settings.login = '********'
args.settings.password = '********'
return 'The Email has been sent successfully.'
viewer.options.toolbar.showSendEmailButton = True
viewer.onEmailReport += emailReportonEmailReport— fires after the report is exported for sending; set the SMTPsettingshere.toolbar.showSendEmailButton = True— reveals the viewer's Send Email button; credentials never leave the server.
How it works. The document is built and mailed server-side, so recipients get the attachment while the mail credentials stay private.