[E2010] [OWA] [C#] [Windows]: Intercepting send mail event in OWA RRS feed

  • Question

  • I have written an Outlook client VSTO 2010 add-in that collects security classification information (collated from a windows dialog asking for a couple of pieces of info) when the user sends an email.
    The collated information is saved into an internet mail header and some of the information is visibly stamped on the mailitem before being sent.

    I would like to provide that functionality within OWA too.

    The OWA customisation articles on MSDN ( describe adding custom forms but as far as I can see I can't get a form to appear when the user presses send when composing a mail, therefore I can't see how I can collect extra information for a mail whilst writing it / before it gets sent.
    And even if I could collect the information during the email compose stage, how could I validate existence if I can't intercept the send mail event.

    I've ruled out an Outlook Message Classification approach ( as this only collects a single piece of classification information. I need to collect more info and also allow the user to enter his own classification text.

    The only idea I have left is to create a custom class and form derived from IPM.Note to mimic the regular compose mail page. When the user sends a mail - he will have to select my custom form instead of a normal message and I'll be able to collect the regular mail information plus the required classification information.
    When the page posts back and hits my code on the server, I'd need to process the info, change to a regular mail item, add the internet mail header and perform visible updates and send the mail on it's way as if it were a normal mail.

    I'm worried about there being something in there that is actually not feasible, and also the amount of work. I don't really know to what extent I can derive from IPM.Note - it may be that everything I do will have to be custom written.

    Finally I worry that I won't be able to force the user into selecting my classification mail. I don't know if I can disable the existing "New Mail" option.

    Any ideas on this or another approach?
    Tuesday, July 23, 2013 4:36 PM

All replies

  • What abot a web page rather than a customisation of Outlook / OWA to compose the email and to collect and attach the data ?

    As long as your Exchange is not hosted / Office 365 you could use a transport agent (a tranport agent sees ALL email passing though an exchange) to check the required additional data is present - you could send a reply back to the user (with a link) to have them complete the missing information if it's not (i.e. if the've just used a regular send)... just a thought.

    Scott Quinn | C# developer & messaging specialist (for hire). Contact me at

    • Edited by Scott Quinn Saturday, August 3, 2013 12:20 PM clarification
    Saturday, August 3, 2013 12:06 PM
  • Thanks Scott,

    I'm trying to get as integrated (with OWA) a solution as possible. Do you think I can hijack the new mail event and launch my own compose mail web page instead of the regular compose mail page?

    Even if that's not possible, something like this approach may still end up being the best fit.

    Thanks for your input.

    Sunday, August 4, 2013 9:57 PM