How to convert MS Outlook MSG message to RFC EML format.

With using Extended Messaging API (EMAPI), IStream interface or Mailbox SDK.

Note:
The MSG format is closed. Email saved in MSG files are a repository flows, to work with the data flow can be using the IStream interface. Email in the MSG format does not contain a full copy of the RFC email.

Using Extended Messaging API you can read a separate fields MSG and put into new creation EML file or obetk, these fields are:
PR_CONTENT_IDENTIFIER, PR_SUBJECT, PR_SENDER_NAME, PR_SENDER_EMAIL_ADDRESS_W, PR_TRANSPORT_MESSAGE_HEADERS_W, PR_CREATION_TIME, PR_MESSAGE_SIZE, PR_CLIENT_SUBMIT_TIME. To obtain these properties use the letters HrGetOnePropEx (IMessage, PropertyTag, MessageProperty).

To extract the list of recipients of email, you need to benefit from the method IMessage GetRecipientTable for PR_DISPLAY_NAME, PR_EMAIL_ADDRESS, PR_RECIPIENT_TYPE where type MAPI_TO, MAPI_CC or MAPI_BCC.
For message body or use PR_BODY_W PR_BODY.

Using IStream Interface.
Use flows names with the prefix '__substg1.0_nnnnnn' nnnnnn room where you want to tag shesnadtseterichnoy records.
For example:
EMAPI TAG PR_SUBJECT = 00370000 Hex + 1E Hex (PT_STRING8 type) then addressed a letter Subject to the flow inside the MSG file __substg1.0_0037001E.

Using Mailbox SDK API:


GetMailInEMLFormat (True);
PSTHandle = OpenMailbox ( 'FullPath and PST file name');
GetMail (PSTHandle, FolderCount, MailCount, Mail);

In this program code is no COM objects and not fill the complex data structures.
You specify the full path and file name any PST Mailbox files.
The Mailbox SDK API GetMailInEMLFormat store all message data only on RFC EML format.
The Mail returned in RFC EML format only.