Saving unsent message to Sent Folder

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
 
D

Dmitry Streblechenko

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
 
S

Saurabh Aggarwal via OfficeKB.com

Hi Dmitry

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

Regards

Saurabh
 
D

Dmitry Streblechenko

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
 

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