abduls85
abduls85

Reputation: 548

How to detect when a specific mail item has been sent out using c#

I have a problem and need some help. My application uses outlook to send email with attachments. Right now i need to find out when the email with attachment has been send out completely by outlook. I tried to follow this link but the ItemEvents_10_SendEventHandler does not fulfil my task as outlook will still be attaching the document when this event is fired. I found out that the email takes time to send out due to the attachment and the duration depends on the attachment size. I want my program to be notified if possible or wait until the email has been send out completely. Can someone guide me or tell me the approach on how to get this to work. Any help provided will be greatly appericiated.

Upvotes: 0

Views: 1537

Answers (2)

abduls85
abduls85

Reputation: 548

I have a solution. Basically i will check the outbox continously for the subject of the email. If it is there continue to check until it is not in outbox. I also have a thread that will stop the checking process if the email is not sent within 5 minutes. Problem solved.

Upvotes: 0

BugFinder
BugFinder

Reputation: 17868

As a stab in the dark, can you not retrieve the item ID from the item events handler, and then check to see when its moved from the Outbox?

Upvotes: 0

Related Questions