MailMessageLoadMessage Method (Stream) |
Loads the message from a stream.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool LoadMessage(
Stream stream
)
Public Function LoadMessage (
stream As Stream
) As Boolean
Parameters
- stream
- Type: System.IOStream
The stream containing the MIME source of the message.
Return Value
Type:
Booleantrue if the message was successfully loaded; otherwise,
false.
Exceptions Remarks Examples This sample loads the message from the stream and displays the subject of the message.
using System.IO;
using MailBee;
using MailBee.Mime;
using (FileStream fs = new FileStream(@"C:\Docs\TestMail.eml", FileMode.Open))
{
MailMessage msg = new MailMessage();
msg.LoadMessage(fs);
Console.WriteLine(msg.Subject);
}
Imports System.IO
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
Dim fs As FileStream
Try
fs = New FileStream("C:\Docs\TestMail.eml", FileMode.Open)
msg.LoadMessage(fs)
Console.WriteLine(msg.Subject)
Finally
If Not fs Is Nothing Then
fs.Close()
End If
End Try
See Also