Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Outlook
I create web site using asp.net 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 = "chandana.pushpakumara@hayleysadvantis.com";
mEmail.Subject = "AMS Filling";
mEmail.Display();
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
v2
Comments
Sandeep Mewara at 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 at 19-Sep-12 2:24am
   
I want to Open Outlook in client machine and Web application run in server
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can use simple link to open outlook as
 
<a href="mailto:">mail</a>
  Permalink  
Comments
pvchandana at 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 at 19-Sep-12 2:44am
   
You can send mail with attachment using System.Net.Mail.
see
http://stackoverflow.com/questions/1195111/c-sharp-mailto-with-attachment
pvchandana at 19-Sep-12 7:49am
   
I do not want to send the email i want to open outlook with attachment
Calvijn at 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
good
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
http://support.microsoft.com/kb/870655[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 7,800
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 24 Feb 2014
Copyright © CodeProject, 1999-2014
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