Click here to Skip to main content
11,927,006 members (49,559 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET Outlook
I create web site using and I want to open outlook window in local machine when click the button

I do this:
Microsoft.Office.Interop.Outlook.Application mApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.MailItem mEmail = null;
mEmail = (Microsoft.Office.Interop.Outlook.MailItem)mApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
mEmail.To = "";
mEmail.Subject = "AMS Filling";
This code run perfectly my local machine but i host the web site in IIS server give the following error:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

Please can any one help me to solve this problem

Thank you
Posted 18-Sep-12 20:48pm
Edited 18-Sep-12 21:11pm
Sandeep Mewara 19-Sep-12 2:13am
I hope you understand that you are trying to open Outlook on webserver and not on client system.

If you are aware of it, I would like to know the use-case where you have to open outlook on webserver via web application.
pvchandana 19-Sep-12 2:24am
I want to Open Outlook in client machine and Web application run in server
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can use simple link to open outlook as

<a href="mailto:">mail</a>
pvchandana 19-Sep-12 2:22am
This work with out attachment but I want to attach excel file with email.
If you have to solution how to attach file please tell me

Thank you for you answer
Uma Shankar Patel 19-Sep-12 2:44am
You can send mail with attachment using System.Net.Mail.
pvchandana 19-Sep-12 7:49am
I do not want to send the email i want to open outlook with attachment
Calvijn 25-Feb-14 14:54pm
The href "mailto:" is not bind to Outlook.
It just open the installed "Default" E-Mail Program on the client.
So it could be any E-Mail Software besides Outlook...
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

it is because of the privilege issues of processes.I hope this link will help[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 24 Feb 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100