public MailMessage GetMessage(ICollection<X509Certificate2> certificates) { var template = new ExpiringCertificatesTemplate { ServerName = Environment.MachineName, ExpiringCertificates = certificates }; var message = new MailMessage {Subject = template.Title}; var msg = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(template.TransformText())); var htmlView = AlternateView.CreateAlternateViewFromString(msg, null, MediaTypeNames.Text.Html); message.AlternateViews.Add(htmlView); return message; }
public MailMessage GetMessage(ICollection <X509Certificate2> certificates) { var template = new ExpiringCertificatesTemplate { ServerName = Environment.MachineName, ExpiringCertificates = certificates }; var message = new MailMessage { Subject = template.Title }; var msg = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(template.TransformText())); var htmlView = AlternateView.CreateAlternateViewFromString(msg, null, MediaTypeNames.Text.Html); message.AlternateViews.Add(htmlView); return(message); }