A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Changing Content-Type of MailItem



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 4th 08, 06:02 PM posted to microsoft.public.outlook.program_addins
CuSo4
external usenet poster
 
Posts: 3
Default Changing Content-Type of MailItem

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  
Old April 5th 08, 05:20 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Changing Content-Type of MailItem

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  
Old April 5th 08, 06:27 PM posted to microsoft.public.outlook.program_addins
CuSo4
external usenet poster
 
Posts: 3
Default Changing Content-Type of MailItem

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  
Old April 7th 08, 07:33 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Changing Content-Type of MailItem

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  
Old April 9th 08, 11:55 PM posted to microsoft.public.outlook.program_addins
CuSo4
external usenet poster
 
Posts: 3
Default Changing Content-Type of MailItem

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 08:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.