MailBee.NET Objects 3.1

MailMessage.RawHeader Property

Gets the message header section exactly as it is contained in the message.

public string RawHeader {get;}

Property Value

A string containing the full header of the message.

Remarks

To get the entire source of the message including its header and body sections, use GetMessageRawData method.

Note   In MIME, the header of the message constists of name-value pairs which are also called headers. RawHeader refers to the former (also known as "full header"). Similar reusage of the same term takes place for a body. In MIME, a body section is the remaining part of the message after the header section. It includes attachments and text bodies of a message. The entire source of the message (the header section and the body section) is often called raw body.

Example

This sample loads the message from .EML file and displays the raw header of this 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\TestMail1.eml");

Console.WriteLine(msg.RawHeader);
[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\TestMail1.eml")

Console.WriteLine(msg.RawHeader)

See Also

MailMessage Class | MailBee.Mime Namespace | GetMessageRawData