MAPI Named Properties Between Servers

O

Overcammed

Hello,

I need to be able to set name/value pairs on an email message within
Outlook, and have those name/values travel with the email when the
email is sent to a user on another exchange server. So far I have
tried adding a UserProperty via the Outlook COM object model (in C#),
and adding a named property to the custom named property stream
"{00020386-0000-0000-C000-000000000046}" via Extended MAPI (in C++).

Using the UserProperty approach did not work at all, the properties
never appeared on the second server. In the case of Extended MAPI, I
set the Type, Name, ID, etc. of the property correctly (I believe), but
the property never appeared on the second server either.

Has anyone ever attempted this and had success? The MAPI documentation
mentions making the named properties "Persistent", but I cannot find
any documentation on functions to do so, or what this involves. Does
anyone know if Outlook SP2's security changes affect these API calls?

Any help is greatly appreciated, thanks,

Sam
 
D

Dmitry Streblechenko

Are these two Exchage servers on the same domain or is the message sent via
SMTP?
The named properties are preserved if the message is sent in the RTF format
(the infamous winmail.dat attachment that Outlook on the receiving side
processes automatically) or if you create a named property with a special
GUID - see http://www.dimastr.com/redemption/faq.htm#14; in this case the
named property will be converted to a MIME header and you will be able to
retrieve it from the PR_TRANSPORT_MESSAGE_HEADERS property.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
O

Overcammed

Dmitry,

Thank you very very much for your help! The servers in question are on
2 different domains - they are seperated from each other over a DSL
connection (one in Ohio and one in Virginia). Does this mean they are
using SMTP to communicate?

I tried the steps you suggested, however, I'm seeing a few things that
don't make sense to me yet. Below are the steps that I took, but as
you can see, I do not see my custom named property that I added to the
special GUID mentioned in your FAQ
({00020386-0000-0000-C000-000000000046}) in the message transport
headers.

Additionally, when I force Outlook to send the email to Server2 in Rich
Text, I still do not see the property in the message or in the
transport header.

Steps:
1. Create New Email on Server1
2. Use OutlookSpy to add Named Property:
Guid: {00020386-0000-0000-C000-000000000046}
Kind: MNID_STRING
ID: nptest
ValueType: PT_STRING8
value: Server1
3. I then can see "nptest" in OutlookSpy
4. Forward to user on Same Server (Server1): As you mention in your
FAQ, the property does not persist (is not visible in OutlookSpy)
because it was sent to an account on the same server (no
PR_TRANSPORT_MESSAGE_HEADERS was created).
5. Send message to user on a different server, which is on a different
domain (Server2).
6. (Note - when I viewed the IMessage using OutlookSpy from the
Composition window, no "nptest" existed).
7. When I receive the email on Server2, open it in OutlookSpy, but I
don't see an nptest named property (which is expected if I understand
correctly). I do see a PR_TRANSPORT_MESSAGE_HEADERS property, but its
contents do not contain any "nptest" header value. Its contents are
below. How do I force outlook to add "nptest" as a header value?

Server2's header info:
----------------------
Microsoft Mail Internet Headers Version 2.0
Received: from alpha.TrustedEdge.com ([192.168.5.11]) by
bravo.trustededge.net with Microsoft SMTPSVC(6.0.3790.1830);
Thu, 20 Apr 2006 09:26:11 -0400
content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C6647E.222976FC"
X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0
Subject: FW: Branding Test Email
Date: Thu, 20 Apr 2006 09:27:12 -0400
Message-ID:
<[email protected]>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: Branding Test Email
Thread-Index: AcZkfSNXeFAcrIKZQiaOkU0tXj8n+wAAMCzg
From: "Sam Schutte" <[email protected]>
To: <[email protected]>
Return-Path: (e-mail address removed)
X-OriginalArrivalTime: 20 Apr 2006 13:26:11.0602 (UTC)
FILETIME=[FDA8B720:01C6647D]

------_=_NextPart_001_01C6647E.222976FC
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

------_=_NextPart_001_01C6647E.222976FC
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


------_=_NextPart_001_01C6647E.222976FC--
 
O

Overcammed

Oh - additionally, when I forward the email from Outlook to my Yahoo
account, I do not see any Winmail.dat attached to the message...

Hmm...just had a thought...could the problem be that I'm _forwarding_
the message? That is, the original message has the named properties
added, but when it gets forwarded, is it considered a new message, and
therefore has no properties at all (starts off blank)? Hadn't
considered this situation...

-Sam
 
O

Overcammed

Ok - I think I figured it out (sorry for talking to myself on this
board for the last few posts!).

The problem was that I was forwarding the messages. When I created a
new message and added a property to
"{00020386-0000-0000-C000-000000000046}" within the message composition
window, then on the external server, the property appeared in the
Message Headers. When I sent the message to an account on the same
mail server, it appeared as normal within the properties list.

Thanks a million Dmitry, you definately pointed me in the right
direction!

-Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top