public static string CreateBodyTextForForward(Message source, bool appendSignature) { StringBuilder sb = new StringBuilder(); AppendSignature(appendSignature, sb); sb.AppendLine("<br /><br />"); sb.AppendLine("---------- Forwarded message ----------<br />"); sb.AppendFormat("From: {0}\n<br />", source.From.ToEncodedString()); sb.AppendFormat("Date: {0}\n<br />", source.DateReceived ?? source.DateSent); sb.AppendFormat("Subject: {0}\n<br />", source.Context); sb.AppendFormat("To: {0}\n<br />", source.To.ToEncodedString()); if (source.CC.Count > 0) sb.AppendFormat("CC: {0}\n<br />", source.CC.ToEncodedString()); sb.Append("<br /><br />"); var access = new ClientMessageAccess(source); var sanitizer = new HtmlSanitizer(); var sanitized = sanitizer.Sanitize(access.GetBestBodyMatch(TextConversion.ToHtml)); sb.Append(sanitized); return sb.ToString(); }
internal string GetMessageHtmlView() { var access = new ClientMessageAccess(source); var sanitizer = new HtmlSanitizer(); sanitizer.NodeVisited += SanitizerNodeVisited; var sanitized = sanitizer.Sanitize(access.GetBestBodyMatch(TextConversion.ToHtml)); return sanitized; }