private static MailAttachment CreateHtmlAttachment(string name, string html) { Debug.AssertStringNotEmpty(name); Debug.AssertStringNotEmpty(html); return MailAttachment.CreateAttachmentFromString(html, name + ".html", Encoding.UTF8, "text/html"); }