PstMessage.GetAsMailMessage Method (Boolean)
PstMessageGetAsMailMessage Method (Boolean)
Gets this PST object as MailMessage object with or without "X-Msg" headers.

Namespace: MailBee.Outlook
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public MailMessage GetAsMailMessage(
	bool includeHeaders


Type: SystemBoolean
If true, "X-Msg" headers will be included in the resulting message; otherwise, not.

Return Value

Type: MailMessage
A MailMessage object representing an e-mail exracted from .PST file.

"X-Msg" headers are PstFields values converted into strings and added to the message as "X-Msg-" + PstFieldName headers. You can access PstFields separately and specify includeHeaders as false if you do not want to add these values as the message headers (useful if you want to keep the message in its original form).

Using PstFields instead of accessing "X-Msg" headers has another benefit. "X-Msg" headers are already converted to strings while PstFields values keep their original data types. The only reason to have "X-Msg" headers in the message is if you want to transfer the message to another system or save it into a file/stream/.XML and process the message later.

See Also