MailMessageGetMessageRawData Method
Gets the source of the message as a byte array.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public byte[] GetMessageRawData()

Return Value

Type: Byte
A byte array representing the MIME source of the message.
Remarks
To get only a header section of the message, use RawHeader property. To save the message to disk or into a stream, use SaveMessage(String) method.
Examples
This sample saves the MIME source of the message into .EML file for demonstration purposes only. Real-world applications should use SaveMessage(String) method for this.
using System.IO;
using MailBee;
using MailBee.Pop3Mail;
using MailBee.Mime;

class Sample
{
    static void Main(string[] args)
    {
        // Download the first mail message from the specified POP3 account.
        MailMessage msg = Pop3.QuickDownloadMessage("mail.company.com", "jdoe", "password", 1);

        // Save message as .EML file.
        using (BinaryWriter bw = new BinaryWriter(File.Open(@"C:\Temp\msg.eml",
            FileMode.Create)))
        {
            bw.Write(msg.GetMessageRawData());
        }
    }
}
See Also