PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Program Addins
Persistent MAPI Properties
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Program Addins
Persistent MAPI Properties
![]() |
Persistent MAPI Properties |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello,
What I am attempting to do is to set a value in a mail message on the senders side that will be accessible on the recipients side. I was under the impression that Mapi properties, using the UserProperties collection was the way to go. I was using the UserProperties collection but the property was always gone on the reciepients side. In reading the MAPI API it seems like this should be possible to create transmitable properties. What am I doing wrong? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
This should work, but only if you are sending the message in rich-text format.
-- Sue Mosher, Outlook MVP Outlook and Exchange solutions at http://www.slipstick.com Author of Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Andrew Roesch" <junk@digitaldetonator.com> wrote in message news:1dfe51fb.0312101311.1ce7dfb@posting.google.com... > Hello, > > What I am attempting to do is to set a value in a mail message on the > senders side that will be accessible on the recipients side. I was > under the impression that Mapi properties, using the UserProperties > collection was the way to go. > > I was using the UserProperties collection but the property was always > gone on the reciepients side. In reading the MAPI API it seems like > this should be possible to create transmitable properties. > > What am I doing wrong? |
|
|
|
#3 |
|
Guest
Posts: n/a
|
"Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in
news:#DLLcp2vDHA.2452@tk2msftngp13.phx.gbl: > This should work, but only if you are sending the message in rich-text > format. Then how do I send a message in rich-text format programmatically? What are the consequences of sending all mails in rich-text format? Here is the code I use to send messages written in c# and using redemption. SafeMailItem safeMailItem = new SafeMailItem(); // Begin the Forward Process // Creates a Forward Message MailItem forward = mailItem.Forward(); // Sets forward message as the SafeMAilItem safeMailItem.Item = forward; safeMailItem.Recipients.Add("Test Email"); safeMailItem.Send(); |
|
|
|
#4 |
|
Guest
Posts: n/a
|
If you send in the RTF format, only Outlook users will be able to read the
data correctly - you will get the infamous winmail.dat attachment. The only workaround is to add custom headers to the message header using Extended MAPI, CDO 1.21 or Redemption: http://www.dimastr.com/redemption/faq.htm#14 The sample sets the Sender header, but it can be used to add any other header. On the receiving side you can access PR_TRANSPORT_MESSAGE_HEADERS property and see if your header is there. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Andrew Roesch" <junk@digitaldetonator.com> wrote in message news:1dfe51fb.0312101311.1ce7dfb@posting.google.com... > Hello, > > What I am attempting to do is to set a value in a mail message on the > senders side that will be accessible on the recipients side. I was > under the impression that Mapi properties, using the UserProperties > collection was the way to go. > > I was using the UserProperties collection but the property was always > gone on the reciepients side. In reading the MAPI API it seems like > this should be possible to create transmitable properties. > > What am I doing wrong? |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Assuming you are using Outlook 2002 or later, you can set the BodyFormat property when you create a new message. I have not tried doing this with a forward, though. Let us know if it works.
-- Sue Mosher, Outlook MVP Outlook and Exchange solutions at http://www.slipstick.com Author of Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Andrew" <junk@digitaldetonator.com> wrote in message news:Xns944DA1769A757junkdigitaldetonator@207.46.248.16... > "Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in > news:#DLLcp2vDHA.2452@tk2msftngp13.phx.gbl: > > > This should work, but only if you are sending the message in rich-text > > format. > > Then how do I send a message in rich-text format programmatically? > What are the consequences of sending all mails in rich-text format? > Here is the code I use to send messages written in c# and using > redemption. > > SafeMailItem safeMailItem = new SafeMailItem(); > // Begin the Forward Process > // Creates a Forward Message > MailItem forward = mailItem.Forward(); > // Sets forward message as the SafeMAilItem > > safeMailItem.Item = forward; > safeMailItem.Recipients.Add("Test Email"); > > safeMailItem.Send(); |
|
|
|
#6 |
|
Guest
Posts: n/a
|
"Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in
news:eykgpj3vDHA.2460@TK2MSFTNGP10.phx.gbl: > Assuming you are using Outlook 2002 or later, you can set the > BodyFormat property when you create a new message. I have not tried > doing this with a forward, though. Let us know if it works. > Setting the BodyFormat does not work. I am currently trying Dmitry's suggestion. |
|
|
|
#7 |
|
Guest
Posts: n/a
|
When you do this, do you have to use a pre-exisitng header? The example
you gave works fine. I was just wondering if you can add a completely new header instead of reusing the "From". If not, does changing this header information have any detrimental side effects and if so what headers would be alright to change? "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in news:uaWkyQ3vDHA.2360@TK2MSFTNGP10.phx.gbl: > If you send in the RTF format, only Outlook users will be able to read > the data correctly - you will get the infamous winmail.dat attachment. > The only workaround is to add custom headers to the message header > using Extended MAPI, CDO 1.21 or Redemption: > http://www.dimastr.com/redemption/faq.htm#14 > The sample sets the Sender header, but it can be used to add any other > header. > On the receiving side you can access PR_TRANSPORT_MESSAGE_HEADERS > property and see if your header is there. > > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > |
|
|
|
#8 |
|
Guest
Posts: n/a
|
It can be anything you want, just replace "Sender" with
"X-My-Coolest-Header". Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Andrew" <junk@digitaldetonator.com> wrote in message news:Xns944DB39AAEAB0junkdigitaldetonator@207.46.248.16... > When you do this, do you have to use a pre-exisitng header? The example > you gave works fine. I was just wondering if you can add a completely new > header instead of reusing the "From". > > If not, does changing this header information have any detrimental side > effects and if so what headers would be alright to change? > > > > "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in > news:uaWkyQ3vDHA.2360@TK2MSFTNGP10.phx.gbl: > > > If you send in the RTF format, only Outlook users will be able to read > > the data correctly - you will get the infamous winmail.dat attachment. > > The only workaround is to add custom headers to the message header > > using Extended MAPI, CDO 1.21 or Redemption: > > http://www.dimastr.com/redemption/faq.htm#14 > > The sample sets the Sender header, but it can be used to add any other > > header. > > On the receiving side you can access PR_TRANSPORT_MESSAGE_HEADERS > > property and see if your header is there. > > > > Dmitry Streblechenko (MVP) > > http://www.dimastr.com/ > > OutlookSpy - Outlook, CDO > > and MAPI Developer Tool > > |
|
|
|
#9 |
|
Guest
Posts: n/a
|
This seems to work except that it seems that some mail servers modify the
text of my header values. It is most often the addition of a carriage return, a newline, and a tab (Ascii values 13, 10, 9). Sometimes it is only a carriage return, and newline. There does not seem to be any pattern to where this occurs. How do I prevent this from happening since it makes parsing these strings problematic? "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in news:ucmqeK4vDHA.2440@TK2MSFTNGP12.phx.gbl: > It can be anything you want, just replace "Sender" with > "X-My-Coolest-Header". > > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > |
|
|
|
#10 |
|
Guest
Posts: n/a
|
If the header+value length exceeds 72 chars, the line must be wrapped
around, this is just an RFC 822 requirement. To unwrap, read the next line and check if the first character is space or tab. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Andrew" <junk@digitaldetonator.com> wrote in message news:Xns94519E5FBE62junkdigitaldetonator@207.46.248.16... > This seems to work except that it seems that some mail servers modify the > text of my header values. It is most often the addition of a carriage > return, a newline, and a tab (Ascii values 13, 10, 9). Sometimes it is > only a carriage return, and newline. There does not seem to be any > pattern to where this occurs. > > How do I prevent this from happening since it makes parsing these strings > problematic? > > "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in > news:ucmqeK4vDHA.2440@TK2MSFTNGP12.phx.gbl: > > > It can be anything you want, just replace "Sender" with > > "X-My-Coolest-Header". > > > > Dmitry Streblechenko (MVP) > > http://www.dimastr.com/ > > OutlookSpy - Outlook, CDO > > and MAPI Developer Tool > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

