Converter.Convert

Converter.Convert method

Detects the email file type based on its extension and delegates to the appropriate converter.

public static Task Convert(Stream input, string nameWithExtension, IOutputHandler handler, 
    string outputType)
ParameterTypeDescription
inputStreamThe input stream representing the email file.
nameWithExtensionStringThe original name of the file with its extension.
handlerIOutputHandlerThe output handler responsible for writing the converted file.
outputTypeStringThe desired output format (e.g., “eml”, “msg”, “html”).

Return Value

A task that represents the asynchronous conversion operation.

Examples

using var input = File.OpenRead("email.msg");
var outputHandler = new FolderOutputHandler("C:\\Output");
await Converter.Convert(input, "email.msg", outputHandler, "eml");

See Also