![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
I'm trying to develop an Outlook Add-in in C# that intercepts outgoing emails with the "ApplicationEvents_11_ItemSendEventHandler" and modifies the message. The Add-in should also change the "Content-Type" header of the message. It seems like the "MailItem" interface does not expose properties to manipulate the "Content-Type" header, and I suspect the headers are not set yet when the ItemSend event is fired, but does someone know any other way to achieve this? Thanks in advance! |
Ads |
#2
|
|||
|
|||
![]()
Why exactly are you trying to do that?
-- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "CuSo4" wrote in message ... Hi, I'm trying to develop an Outlook Add-in in C# that intercepts outgoing emails with the "ApplicationEvents_11_ItemSendEventHandler" and modifies the message. The Add-in should also change the "Content-Type" header of the message. It seems like the "MailItem" interface does not expose properties to manipulate the "Content-Type" header, and I suspect the headers are not set yet when the ItemSend event is fired, but does someone know any other way to achieve this? Thanks in advance! |
#3
|
|||
|
|||
![]()
Dmitry,
Thanks for your reply! As part of my master thesis, I implemented an RSA CSP in c# that allows to create digital signatures on smart cards. I'm able to use this CSP to create smartcard based S/MIME detached signatures for emails. For my demo, I would like to integrate this functionality in an Outlook Add-In. Basically, I retrieve the Body from the MailItem upon sending, compute the S/MIME signature, and add it as an attachment to the MailItem. However, client email applications are not able to interpret the S/MIME attachment, as the Content-Type header is "multipart/mixed". I should set it to "multipart/signed" instead. I read about setting the message class to IPM.Note.SMIME.MultipartSigned, but if I understand it correctly, this will cause outlook itself to sign the email. As the goal is to demonstrate the use of the RSA CSP using c#, setting the message class to IPM.Note.SMIME.MultipartSigned is not of much help in this case... "Dmitry Streblechenko" wrote: Why exactly are you trying to do that? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "CuSo4" wrote in message ... Hi, I'm trying to develop an Outlook Add-in in C# that intercepts outgoing emails with the "ApplicationEvents_11_ItemSendEventHandler" and modifies the message. The Add-in should also change the "Content-Type" header of the message. It seems like the "MailItem" interface does not expose properties to manipulate the "Content-Type" header, and I suspect the headers are not set yet when the ItemSend event is fired, but does someone know any other way to achieve this? Thanks in advance! |
#4
|
|||
|
|||
![]()
If you need to be able to control the MIME structure of the outgoing
message, you need to implement a transport provider thaat explciitly converst a MAPI message to a MIME message. In some cases (e.g. when a message is sent between two Exchange mailboxes), the message might not even be ever converted to MIME. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "CuSo4" wrote in message ... Dmitry, Thanks for your reply! As part of my master thesis, I implemented an RSA CSP in c# that allows to create digital signatures on smart cards. I'm able to use this CSP to create smartcard based S/MIME detached signatures for emails. For my demo, I would like to integrate this functionality in an Outlook Add-In. Basically, I retrieve the Body from the MailItem upon sending, compute the S/MIME signature, and add it as an attachment to the MailItem. However, client email applications are not able to interpret the S/MIME attachment, as the Content-Type header is "multipart/mixed". I should set it to "multipart/signed" instead. I read about setting the message class to IPM.Note.SMIME.MultipartSigned, but if I understand it correctly, this will cause outlook itself to sign the email. As the goal is to demonstrate the use of the RSA CSP using c#, setting the message class to IPM.Note.SMIME.MultipartSigned is not of much help in this case... "Dmitry Streblechenko" wrote: Why exactly are you trying to do that? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "CuSo4" wrote in message ... Hi, I'm trying to develop an Outlook Add-in in C# that intercepts outgoing emails with the "ApplicationEvents_11_ItemSendEventHandler" and modifies the message. The Add-in should also change the "Content-Type" header of the message. It seems like the "MailItem" interface does not expose properties to manipulate the "Content-Type" header, and I suspect the headers are not set yet when the ItemSend event is fired, but does someone know any other way to achieve this? Thanks in advance! |
#5
|
|||
|
|||
![]()
Thanks for the insight!
Actually, as I wanted to keep it in c#, I implemented an smtp proxy that does the job. "Dmitry Streblechenko" wrote: If you need to be able to control the MIME structure of the outgoing message, you need to implement a transport provider thaat explciitly converst a MAPI message to a MIME message. In some cases (e.g. when a message is sent between two Exchange mailboxes), the message might not even be ever converted to MIME. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "CuSo4" wrote in message ... Dmitry, Thanks for your reply! As part of my master thesis, I implemented an RSA CSP in c# that allows to create digital signatures on smart cards. I'm able to use this CSP to create smartcard based S/MIME detached signatures for emails. For my demo, I would like to integrate this functionality in an Outlook Add-In. Basically, I retrieve the Body from the MailItem upon sending, compute the S/MIME signature, and add it as an attachment to the MailItem. However, client email applications are not able to interpret the S/MIME attachment, as the Content-Type header is "multipart/mixed". I should set it to "multipart/signed" instead. I read about setting the message class to IPM.Note.SMIME.MultipartSigned, but if I understand it correctly, this will cause outlook itself to sign the email. As the goal is to demonstrate the use of the RSA CSP using c#, setting the message class to IPM.Note.SMIME.MultipartSigned is not of much help in this case... "Dmitry Streblechenko" wrote: Why exactly are you trying to do that? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "CuSo4" wrote in message ... Hi, I'm trying to develop an Outlook Add-in in C# that intercepts outgoing emails with the "ApplicationEvents_11_ItemSendEventHandler" and modifies the message. The Add-in should also change the "Content-Type" header of the message. It seems like the "MailItem" interface does not expose properties to manipulate the "Content-Type" header, and I suspect the headers are not set yet when the ItemSend event is fired, but does someone know any other way to achieve this? Thanks in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Content-Type for encapsulated emails ? | Yakov | Outlook - General Queries | 2 | July 30th 07 07:53 PM |
Changing field type in Contacts | Judy Gleeson \(MVP Outlook\) | Outlook - Using Forms | 1 | December 20th 06 12:33 PM |
Changing RTF Body on MailItem Read event | [email protected] | Add-ins for Outlook | 3 | September 13th 06 07:30 PM |
Email as of type Outlook.MailItem | css | Outlook and VBA | 3 | August 11th 06 05:55 AM |
Help - can't add "Item" (of type MailItem) using Attachments.Add() | [email protected] | Outlook and VBA | 1 | August 3rd 06 05:55 AM |