How can I set the MailMessage's body with a HTML file ?
C# – Send an email with a HTML file as body (C#)
asp.netc
Related Topic
- C# – Deep cloning objects
- C# – How to enumerate an enum
- C# – How to create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office
- Jquery – How to format a Microsoft JSON date
- C# – Case insensitive ‘Contains(string)’
- C# – How to get a consistent byte representation of strings in C# without manually specifying an encoding
- C# – a NullReferenceException, and how to fix it
- C# – File Upload ASP.NET MVC 3.0
Best Answer
Just set the MailMessage.BodyFormat property to MailFormat.Html, and then dump the contents of your html file to the MailMessage.Body property: