I am working a standalone c# desktop application that sends out documents and then imports them from Outlook when they are sent back. The application picks up the emails from a specified folder processes them and then saves the senders name plus other stuff to a database.
This works well for Outlook 2003 and 2007 which has the SenderEmailAddress property. However Outlook 2000 and XP does not have this property and will not consistently return [email protected]. I am providing support for these versions.
I have found that a library called Outlook Redemption will solve this but I am developing in .net and really want to avoid writing to customer registries. I also found MAPI33 a .Net wrapper around MAPI but it is unclear from the forums whether it is still being supported.
Would appreciate any pointers as to a .Net alternative to the Redemption dll or an approach to being able to consistently retrieve an email address across Outlook versions.
Many thanks
AbsFabs
Epilogue: I ended up using a solution from this article http://support.microsoft.com/kb/324530. It comprised creating a reply and then extracting the reply to address of the created mailitem. It worked well for emails sent over the internet and is currently going through Exchange Server testing.
Also found this on my travels http://anoriginalidea.wordpress.com/2008/01/11/getting-the-smtp-email-address-of-an-exchange-sender-of-a-mailitem-from-outlook-in-vbnet-vsto/ it appears to be a touch involved. This might comprise my plan B if my existing implementation does not survive testing.
Thanks for your feedback
AbsFabs
I ultimately wound up using Redemption. Excellent tool for the job. My issue was with having to register the dll when my app was installed. Since my app is written in dotnet it does not need to register anything. I was able to work around the dll registration issue using registry-free COM.
Many thanks for your inspiration.