Loads the message from the specified file.
true if the message was successfully loaded; otherwise, false.
To save a message into a file, use SaveMessage method.
| Exception Type | Condition |
|---|---|
| MailBeeInvalidArgumentException | filename is a null reference (Nothing in Visual Basic) or an empty string. |
| MailBeeIOException | An I/O error occurred and ThrowExceptions is true. |
This sample loads the message from .EML file and displays the subject of the message.
[C#] // 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);
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.Mime ' The actual code (put it into a method of your class) ' Load the message from file. Dim msg As New MailMessage msg.LoadMessage("C:\Docs\TestMail.eml") Console.WriteLine(msg.Subject)
MailMessage Class | MailBee.Mime Namespace | MailMessage.LoadMessage Overload List | SaveMessage