ConvertEmailToHtml(String,String) Method (EmailDocumentConverter)
In This Topic
Converts Email (.eml, .msg) document to a HTML document with default converter settings.
Syntax
'Declaration
Public Overloads Shared Function ConvertEmailToHtml( _
ByVal As System.String, _
ByVal As System.String _
) As System.String[]
public static System.String[] ConvertEmailToHtml(
System.String ,
System.String
)
public: static System.String[] ConvertEmailToHtml(
System.String ,
System.String
)
public:
static System.String[] ConvertEmailToHtml(
System.String ,
System.String
)
Parameters
- emailFilename
- The filename of input Email (.eml, .msg) document.
- htmlFilename
- The filename of output HTML document.
Return Value
An array that contains name of HTML file and names of resource files.
Example
This C#/VB.NET code shows how to convert Email document to a HTML document.
''' <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
/// <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());
}
Requirements
Target Platforms: .NET 11; .NET 10; .NET 9; .NET 8; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5
See Also