Show a draft mail as sent mail

  • Thread starter Thread starter Ettore
  • Start date Start date
E

Ettore

I have a similar problem.
I want to send a mail and I want to save, in the Sent Items folder, another
mail (different from the first one because I change the body).

At the moment I set the attribute DeleteAfterSubmit to true. Then I copy the
mail in the Sent Items Folder (changing the body) and finally I send the
mail.
It works...but the mail I saved isn't a sent mail: it is just a mail saved
(as draft) in the Sent Items folder but not sent and the sent date is setted
to none.
So I tryed to set, using CDO, the Sent and the TimeSent attribute: now the
date is setted correctly but the mail is yet shown as draft.

Can anyone help me?
Is it possible to set a draft mail as sent?

Thanks in advance.
Ettore.
 
Create a message as a olPostItem instead (it is created in the sent state),
save it, dereference it, open it using Namespace.GetItemFromID(), set its
MessageClass property to "IPM.Note", save it, dereference it again and
reopen using Namespace.GetItemFromID() - you now have a sent MailItem
object.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Thanks for your answer.
Just another little question....
How can I set that parameters if I have a MailItem?
I used the copy method to obtain a copy of the mail that I want to save, so
I haven't a PostItem.

Thanks again
Ettore.
 
Copy returns a new instance of the same kind (e.g. MailItem), in this case
you can create a brand new post item (Application.Items.Add(olPostItem)),
then copy all relevant properties one by one. Or use Redemption, which has
SafeMailItem.CopyTo() method (allows to copy all properties from one message
to another message passed as an argument).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Thanks again
I supposed it
Bye Ettore

Dmitry Streblechenko said:
Copy returns a new instance of the same kind (e.g. MailItem), in this case
you can create a brand new post item (Application.Items.Add(olPostItem)),
then copy all relevant properties one by one. Or use Redemption, which has
SafeMailItem.CopyTo() method (allows to copy all properties from one message
to another message passed as an argument).

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