Export mail to outlook ?

Hi - I've googled and I've asked before, but I've not found any clear examples. I want to send mail using .NET, but then place a copy of the mail into Outlook ( and as many versions of outlook as possible ), in the sent items. I want this to happen silently, with no user interaction.

any help is greatly appreciated.




Answer this question

Export mail to outlook ?

  • haiaw

    Generally speaking, later versions of Outlook are compatible with earlier versions of the Outlook PIA. In looking for some more info, I ran across some great posts by Omar Shahine where he documents a lot on writing Outlook add-ins and using the PIAs:
    Admittedly this is about add-ins, but the general information on using the PIAs will likely be helpful.
    In the end, you could always cruft up your own interop assembly by running tlbimp.exe on msoutl.olb (it's just a renamed COM type library - they usually end in .tlb) on the earliest version of Outlook that you want to support. I haven't tried this. So you'll want to read Omar's caveats carefully and test thoroughly especially with other applications that use the PIAs to make sure the final deployed solution will operate correctly.


  • skylar119506

    You would likely be able to do it via COM interop (using the Outlook PIA) to drive Outlook to send the email. Another tactic would be to write an Outlook add-in that opens a .NET Remoting channel and listens. Your application could then determine if your Outlook add-in was listening and send email via the add-in, resulting in a Sent Items entry. If you don't like either of these solutions and want to use System.Net.Mail to actually send, you could BCC the logged-in user (looking up their email address via System.DirectoryServices). You would have to have some identifying tag in your email that would allow a custom Outlook add-in to detect and re-route to Sent Items. Alternatively, you could configure an Outlook filter to do the re-direction. Hopefully some of those ideas help. There's no easy solution that I know of.

  • Daniel Bogdan

    Thanks for this. My client does not want to set anything in outlook, or have any add ins for outlook. A google makes me thing the outlook PIA is for outlook 2003 I would prefer something that works with outlook 2000 at least, if possible.

    Of course, just because the client wants something does not make it possible :-)



  • Export mail to outlook ?