MailBee.NET Objects 7.1

MsgConvert.EmlToMsg Method (String, String)

Converts .EML data (in RFC822 text format) into a file in Outlook .MSG (OLE2) format with 8-bit encoding.

public void EmlToMsg(
   string emlFilename,
   string msgFilename
);

Parameters

emlFilename
The path to the source .EML file.
msgFilename
The path to the target Outlook .MSG file.

Exceptions

Exception Type Condition
MailBeeInvalidArgumentException emlFilename or msgFilename is a null reference (Nothing in Visual Basic).
MailBeeException An error occurred during reading, parsing or saving message data.

Example

This sample converts .EML file into .MSG file.

[C#]
// To use the code below, import these namespaces at the top of your code.
using MailBee;
using MailBee.Outlook;

// The actual code (put it into a method of your class).
MsgConvert conv = new MsgConvert();
conv.EmlToMsg(@"C:\test.eml", @"C:\test.msg");
[Visual Basic]
' To use the code below, import these namespaces at the top of your code.
Imports MailBee
Imports MailBee.Outlook

' The actual code (put it into a method of your class).
Dim conv As MsgConvert = New MsgConvert
conv.EmlToMsg("C:\test.eml", "C:\test.msg")

See Also

MsgConvert Class | MailBee.Outlook Namespace | MsgConvert.EmlToMsg Overload List