Saving unsent message to Sent Folder

  • Thread starter Thread starter Ronnie
  • Start date Start date
R

Ronnie

Hi,

I am developing an Outlook add-in with a send event handler that
modifies the recipient list before the message is sent to redirect the
message to our sever. For this to be seamless to the user, we need to
save the original message that the user has sent with the original
recipient list (before it was re-directed) to the sent folder. We are
able to save a copy of the message before we modify it but the
'date' (MailItem.SentOn) and the 'from' (MailItem.SenderName)
are read only. Is there a way to set those two fields so that it shows
up in the sent folder as if it was actually sent?

Thanks,

Ronnie
 
Not using the Outlook object model. Either Extended MAPI/CDO 1.21/Redemption
are required - on the low level, you will need to set the PR_SENDER_xxx,
PR_SENT_REPRESENTING_xxx and PR_MESSAGE_DELIVERY_TIME/PR_CLIENT_SUBMIT_TIME
properti4es.

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

Could you please give me one working example in C# that uses CDO.

Regards

Saurabh
 
I don't have a ready-to-use example, you will need to use the Message.Fields
collection.
To see which properties you need to set, look at a sent message using
MdbView or OutlookSpy (click IMessage).

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