예제 #1
0
        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;
        }
예제 #2
0
        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);
        }