How to check for unsent email

Previous  Top  Next

    
 

 

Code:

var

   Outbox: MAPIFolder;

   UnsentMail: integer;

...

   Outbox := NmSpace.GetDefaultFolder(olFolderOutbox);

   UnsentMail := Outbox.Items.Count;

   if (UnsentMail > 0) then

     ShowMessage(Format('Unsent items in Outbox: %d', [UnsentMail]));

 

The constant olFolderOutbox is defined in Outlook_TLB as $00000004

©Drkb::04455