MailMessageLoadMessage Method (String)
Loads the message from the specified file.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public bool LoadMessage(
	string filename
)

Parameters

filename
Type: SystemString
The path to the file containing the message in MIME format. The common extension of MIME files is .EML.

Return Value

Type: Boolean
true if the message was successfully loaded; otherwise, false.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionfilename is a null reference (Nothing in Visual Basic) or an empty string.
MailBeeIOExceptionAn I/O error occurred and ThrowExceptions is true.
MailBeeDataParsingExceptionOutlook .MSG file is being loaded instead of MIME (.EML) and ThrowExceptions is true.
Remarks
To save a message into a file, use SaveMessage(String) method.
Examples
This sample loads the message from .EML file and displays the subject of the message.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

// The actual code (put it into a method of your class)

// Load the message from file.
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");

Console.WriteLine(msg.Subject);
See Also