Outlook 2002

Add-in Express™ Support Service
That's what is more important than anything else

Outlook 2002
OnNewMail Event 
H Philip




Posts: 17
Joined: 2005-01-14
I have that problem, somehow the OnNewMail event is not fired when Outlook receives messages as soon as its launched. The event works only from the second messages download.
Any idea?
Posted 08 Jun, 2005 09:56:00 Top
Dmitry Kostochko


Add-in Express team


Posts: 2742
Joined: 2004-04-05
Hi Philip,

Let's look what MS Outlook Help says about this event:

---
NewMail Event

Occurs when one or more new e-mail messages are received in the Inbox.

Remarks

The NewMail event is useful for scenarios in which you want to be notified when a new e-mail message arrives. If you want to process items that arrive in the Inbox, consider using the ItemAdd event on the collection of items in the Inbox. The ItemAdd event passes a reference to each item that is added to a folder.
---

They state here that the OnNewMail event is to be fired when one or more messages are received. So, it is not a problem but rather the behavior by design.

Posted 08 Jun, 2005 10:33:08 Top
Guest


Guest


Dmitry,

All that is known, my purpose in that event is to trap new incoming messages. The problem is that the event does not work when the messages are downloaded when outlook just start, it does work though at the next scheduled send/receive and from on.

Posted 08 Jun, 2005 11:30:04 Top
Dmitry Kostochko


Add-in Express team


Posts: 2742
Joined: 2004-04-05
Philip,

Try to use the OnItemAdd event instead of OnNewMail.

Posted 08 Jun, 2005 11:48:33 Top