Article ID: 178073 - Last Review: August 18, 2005 - Revision: 1.5

How To Obtaining the SMTP Header for a MAPI Message

This article was previously published under Q178073
Expand all | Collapse all

SUMMARY

This article contains a sample function that allows you to access the SMTP header for a message received over the Internet.

MORE INFORMATION

The entire header is stored in the property PR_TRANSPORT_MESSAGE_HEADERS.
   //  GetHeader takes a LPMESSAGE and returns a CString containing
   //  the header for the message.

   CString GetHeader(LPMESSAGE poEnv)
   {
     CString      csHeader;
     HRESULT         hr;
     LPSPropValue   lpProps = NULL;

     // MAPI property creation flags
     const ULONG ulFlags = MAPI_BEST_ACCESS | MAPI_DEFERRED_ERRORS;

     hr = HrGetOneProp(poEnv,PR_TRANSPORT_MESSAGE_HEADERS,&lpProps);
     if (S_OK == hr)
    {
       csHeader = lpProps[0].Value.lpszA;
    }
    return csHeader;
   }
				

APPLIES TO
  • Microsoft Office Outlook 2007
  • Microsoft Messaging Application Programming Interface
Keywords: 
kbcode kbhowto kbmsg KB178073
 

Article Translations

 

Related Support Centers