MailMessageLoadMessage Method (Stream)
Loads the message from a stream.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public bool LoadMessage(
	Stream stream
)

Parameters

stream
Type: System.IOStream
The stream containing the MIME source of the message.

Return Value

Type: Boolean
true if the message was successfully loaded; otherwise, false.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionstream is a null reference (Nothing in Visual Basic).
MailBeeStreamExceptionA stream 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 stream, use SaveMessage(Stream) method.
Examples
This sample loads the message from the stream and displays the subject of the message.
// To use the code below, import these namespaces at the top of your code.
using System.IO;
using MailBee;
using MailBee.Mime;

// The actual code (put it into a method of your class).
using (FileStream fs = new FileStream(@"C:\Docs\TestMail.eml", FileMode.Open))
{
    MailMessage msg = new MailMessage();
    msg.LoadMessage(fs);

    Console.WriteLine(msg.Subject);
}
See Also