VintaSoft Imaging .NET SDK 15.2: Документация для .NET разработчика
В этом разделе
Кодеки: Как преобразовать файл электронной почты в файл HTML?
В этом разделе
Вот C#/VB.NET код, который демонстрирует как преобразовать файл электронной почты в файл HTML:
/// <summary>
/// Converts Email (.msg, .eml) document to a HTML document.
/// </summary>
/// <param name="emailFilePath">Path to a source Email file.</param>
/// <param name="htmlFilePath">Path to a result HTML file.</param>
public static void ConvertEmailToHtml(string emailFilePath, string htmlFilePath)
{
    // directory to save attachments
    string attachmentsDirectoryName = System.IO.Path.GetFileNameWithoutExtension(htmlFilePath) + ".files";

    // convert Email document to a HTML document
    Vintasoft.Imaging.Email.EmailDocumentConverter.ConvertEmailToHtml(
        emailFilePath, htmlFilePath, attachmentsDirectoryName, new Vintasoft.Imaging.Email.EmailToHtmlConverterSettings());
}
''' <summary>
''' Converts Email (.msg, .eml) document to a HTML document.
''' </summary>
''' <param name="emailFilePath">Path to a source Email file.</param>
''' <param name="htmlFilePath">Path to a result HTML file.</param>
Public Shared Sub ConvertEmailToHtml(emailFilePath As String, htmlFilePath As String)
    ' directory to save attachments
    Dim attachmentsDirectoryName As String = System.IO.Path.GetFileNameWithoutExtension(htmlFilePath) & ".files"

    ' convert Email document to a HTML document
    Vintasoft.Imaging.Email.EmailDocumentConverter.ConvertEmailToHtml(emailFilePath, htmlFilePath, attachmentsDirectoryName, New Vintasoft.Imaging.Email.EmailToHtmlConverterSettings())
End Sub