New to Telerik Reporting? Start a free 30-day trial
Implementing Send Mail Message
This tutorial elaborates how to implement the SendMailMessage method of the ReportsController. This is required to enable the send document endpoint used for HTML5 Report Viewer Send Mail Message functionality.
To send e-mail use the MailMessage with SMTP client as shown in the following code snippet:
C#
protected override HttpStatusCode SendMailMessage(MailMessage mailMessage)
{
using (var smtpClient = new SmtpClient("smtp.companyname.com", 25))
{
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.EnableSsl = true;
smtpClient.Send(mailMessage);
}
return HttpStatusCode.OK;
}