How to know whether a mail was sent or saved, while displayed?

Initial situation

  • creating an IRDOMail in drafts, then modifying and saving it
  • displaying it modal via IRDOMail.Display
  • the user then edits the mail and sends, saves or closes it
  • then using NameSpace.SendAndRecive to potentially initiate immediate delivery of all undelivered messages submitted in the current session
  • trying to figure out wether the mail was actually sent or just saved

Problem

  • IRDOMail.Sent, aswell as IRDOMail.Submitted are always false, altough the mail was sent and recieved

Question besides that

  • what's the difference between IRDOMail.Sent and IRDOMail.Submitted?

1 answer

  • answered 2020-11-20 16:46 Dmitry Streblechenko

    Keep in mind that the draft message that you display is physically different from the message in the Sent Items folder - the Sent property cannot be changed if the message has already been saved, Outlook creates a new message in the Sent Items folder.

    After a message is sent, the only valid operation is releasing your reference to it, you should not be checking any of its properties.

    To check if a message is sent, use the Items.ItemAdd event on the Sent Items folder.