How to add custom composed mail into inbox folder?

K

ksskumar

Hi,

I am creating a addin for outlook in C#.

I collect some mails from inbox folder and store the details like
Sendername, CC,BCC, receivedtime, subject, body, etc., into MS Access
database. Also delete the mail from outlook.

Is it possible to regenerate the mail in the inbox folder using the
database details?

In other words, how to add custom composed mailitem into Inbox folder
?

I think, I can use the Send method of the Outlook object model or CDO
or something to send a mail. But I assume, that mail will go the the
CC and BCC persons also.

Thanks in advance,

regards,
Kumar
 
D

Dmitry Streblechenko \(MVP\)

Outlook Object Model is really not the best tool for that.
Create a message as a PostItem rather than a MailItem (it will be created in
the sent state), then change the MessageClass property to "IPM.Note",
dereference the message, then reopen it using Namespace.GetItemFromID - you
will get a MailItem in the sent state.
Note that quite a few properties are read-only in OOM (such as SentOn), but
they can be set using Extended MAPI/CDO 1.21/Redemption. You will also need
to remove the PR_ICON_INDEX property, otherwise the icon will still be the
same post item icon.

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