Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'System.Net.Mail.MailMessage' does not contain a definition for 'AddAttachment' and no extension method 'AddAttachment' accepting a first argument of type 'System.Net.Mail.MailMessage' could be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 1714:            message.Subject = "Bromsgrove School .ics File";
Line 1715:            message.IsBodyHtml = true;
Line 1716:            message.AddAttachment(iCalGenerator.GetFileName());
Line 1717:            smtpClient.Host = "smtp.sendgrid.net";
Line 1718:            var html = msg;

Source File: c:\IIS\bromsgrove-school.co.uk\FullCalendar.aspx.cs    Line: 1716






Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0