New to Telerik Reporting? Download 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:

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;
}
In this article