Question : QueryInterface for interface Microsoft.Office.Interop.O<wbr />utlook._Ap<wbr />plication failed

Hi Experts,

I have developed a niceC# ASPX page that opens outlook message without sending. Just populates message ,body etc. It works perfectly on 2 my development PCs Win PRO, IIS 5
When I deploy it to the server this page is giving me :

Exception Details: System.InvalidCastException: QueryInterface for interface Microsoft.Office.Interop.Outlook._Application failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidCastException: QueryInterface for interface Microsoft.Office.Interop.Outlook._Application failed.]
   Microsoft.Office.Interop.Outlook.ApplicationClass.CreateItem(OlItemType ItemType) +0
   CLA.sendMail.Page_Load(Object sender, EventArgs e)
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750

I check forums, Microsoft site and everything looks ok. DLL is registered, Outlook install on Server as well.

I am just thinking if that ever can work. The page is server side APSX. How it can open outlook new message on clients machine ? May be I am missing something but its odd. May be it just designed to
send mail but not popup outlook new message ? But here I see it cannot CREATE A NEW ITEM ....
Well it means it did not even get to the point of opening new message according to my code.

Please help.

Answer : QueryInterface for interface Microsoft.Office.Interop.O<wbr />utlook._Ap<wbr />plication failed


Surely the web server is talking to Outlook not the client.

If you want to sent emails from Exchange but not use SMTP or the Exchange Interop then you can use this Exchange API (my company use this):

http://www.independentsoft.de/webdavex/index.html
Random Solutions  
 
programming4us programming4us