I wrote the following code:
oApp = new Outlook.Application();
oApp = new Outlook.Application();
oNameSpace= oApp.GetNamespace("MAPI");
oNameSpace.Logon(null,null,true,true);
//gets defaultfolder for my Outlook Outbox
oOutboxFolder =
oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolde rs.olFolderOutbox);
But it won't work and it is giving me the following error:
Server Error in '/SendEmail' Application
--------------------------------------------------------------------------------
Server execution failed
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Server
execution failed
Source Error:
Line 24: {
Line 25: //Return a reference to the MAPI layer
Line 26: oApp = new Outlook.Application();
Line 27: oApp = new Outlook.Application();
Line 28: oNameSpace= oApp.GetNamespace("MAPI");
Source File: c:\inetpub\wwwroot\sendemail\outlookmail.aspx.cs Line: 26
Stack Trace:
[COMException (0x80080005): Server execution failed]
SendEmail.OutlookMail..ctor() in
c:\inetpub\wwwroot\sendemail\outlookmail.aspx.cs:2 6
ASP.OutlookMail_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET
Files\sendemail\c53a1a47\a51e0147\tiscp1-q.0.cs:0
[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +164
[HttpException (0x80004005): Failed to create page of type
'ASP.OutlookMail_aspx'.]
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +337
System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context) +43
System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context, String
requestType, String url, String path) +44
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig) +698
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute() +95
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +173
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.985; ASP.NET
Version:1.1.4322.968 2 4647
Here is a nice little post http://groups.google.com/groups?hl=e...p04%26rnum%3D4
(watch for wraps) that shows how to setup so that you can use outlook in
ASP.NET
That might help.
"Bassel Tabbara" <Bassel Ta*****@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com... I wrote the following code: oApp = new Outlook.Application(); oApp = new Outlook.Application(); oNameSpace= oApp.GetNamespace("MAPI"); oNameSpace.Logon(null,null,true,true); //gets defaultfolder for my Outlook Outbox oOutboxFolder = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolde rs.olFolderOutbox);
But it won't work and it is giving me the following error: Server Error in '/SendEmail' Application. --------------------------------------------------------------------------
------ Server execution failed Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Server execution failed
Source Error:
Line 24: { Line 25: //Return a reference to the MAPI layer Line 26: oApp = new Outlook.Application(); Line 27: oApp = new Outlook.Application(); Line 28: oNameSpace= oApp.GetNamespace("MAPI");
Source File: c:\inetpub\wwwroot\sendemail\outlookmail.aspx.cs Line: 26
Stack Trace:
[COMException (0x80080005): Server execution failed] SendEmail.OutlookMail..ctor() in c:\inetpub\wwwroot\sendemail\outlookmail.aspx.cs:2 6 ASP.OutlookMail_aspx..ctor() in c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files\sendemail\c53a1a47\a51e0147\tiscp1-q.0.cs:0
[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0 System.Activator.CreateInstance(Type type, Boolean nonPublic) +66 System.Web.UI.TemplateControlParser.GetCompiledIns tance(String virtualPath, String inputFile, HttpContext context) +164
[HttpException (0x80004005): Failed to create page of type 'ASP.OutlookMail_aspx'.] System.Web.UI.TemplateControlParser.GetCompiledIns tance(String virtualPath, String inputFile, HttpContext context) +337 System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String virtualPath, String inputFile, HttpContext context) +43 System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context, String requestType, String url, String path) +44 System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String requestType, String path, String pathTranslated, Boolean useAppConfig)
+698
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep
..Execute() +95 System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +173
--------------------------------------------------------------------------
------ Version Information: Microsoft .NET Framework Version:1.1.4322.985;
ASP.NET Version:1.1.4322.968
Hi Girish,
Thanks for the tip. I was thinking in these terms but I don't like the fact
to use the System account. Can I use a different account who has enough
priviliges to access outlook?
Thanks,
Bassel
"Girish bharadwaj" wrote: Here is a nice little post http://groups.google.com/groups?hl=e...p04%26rnum%3D4 (watch for wraps) that shows how to setup so that you can use outlook in ASP.NET
That might help.
"Bassel Tabbara" <Bassel Ta*****@discussions.microsoft.com> wrote in message news:B4**********************************@microsof t.com... I wrote the following code: oApp = new Outlook.Application(); oApp = new Outlook.Application(); oNameSpace= oApp.GetNamespace("MAPI"); oNameSpace.Logon(null,null,true,true); //gets defaultfolder for my Outlook Outbox oOutboxFolder = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolde rs.olFolderOutbox);
But it won't work and it is giving me the following error: Server Error in '/SendEmail' Application. -------------------------------------------------------------------------- ------ Server execution failed Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Server execution failed
Source Error:
Line 24: { Line 25: //Return a reference to the MAPI layer Line 26: oApp = new Outlook.Application(); Line 27: oApp = new Outlook.Application(); Line 28: oNameSpace= oApp.GetNamespace("MAPI");
Source File: c:\inetpub\wwwroot\sendemail\outlookmail.aspx.cs Line: 26
Stack Trace:
[COMException (0x80080005): Server execution failed] SendEmail.OutlookMail..ctor() in c:\inetpub\wwwroot\sendemail\outlookmail.aspx.cs:2 6 ASP.OutlookMail_aspx..ctor() in c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files\sendemail\c53a1a47\a51e0147\tiscp1-q.0.cs:0
[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0 System.Activator.CreateInstance(Type type, Boolean nonPublic) +66 System.Web.UI.TemplateControlParser.GetCompiledIns tance(String virtualPath, String inputFile, HttpContext context) +164
[HttpException (0x80004005): Failed to create page of type 'ASP.OutlookMail_aspx'.] System.Web.UI.TemplateControlParser.GetCompiledIns tance(String virtualPath, String inputFile, HttpContext context) +337 System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String virtualPath, String inputFile, HttpContext context) +43 System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context, String requestType, String url, String path) +44 System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String requestType, String path, String pathTranslated, Boolean useAppConfig) +698 System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep ..Execute() +95 System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +173
-------------------------------------------------------------------------- ------ Version Information: Microsoft .NET Framework Version:1.1.4322.985; ASP.NET Version:1.1.4322.968 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: chak |
last post by:
Hello,
I am trying to access the local PC's Outlook folder , but get this 'Server
execution failed"
error. Any hint where the error is ?
Thanks.
|
by: Chris Gatto |
last post by:
Hello, I'm hoping that someone out there has a wonderfully simple answer for
this - it seems like it should.
I am using an ASP.Net application to try and create calendar appointments in
user's...
|
by: John Smith |
last post by:
Hi,
I'm trying to send email in our C# ASP.Net application using the Outlook 11
library. For a bunch of unimportant reasons (unimportant to this posting
that is) we have to do it this way and...
|
by: John |
last post by:
Hi
When I open a new outlook email from vb.net, sometimes outlook is very slow
to appear or occasionally outlook freezes completely. I am targeting mixed
office2000/xp environments so I am...
|
by: Snig |
last post by:
Hi
I'm into creating a web application in C# (.NET Framework 1.1) which
would list and manage the outlook tasks.
If I try to do this in a Windows Application, it works fine. But there
are...
|
by: msielski |
last post by:
I am posting this here since I don't see an Outlook programming group
specific to .net but only VBA. Please let me know if I'll have better
luck posting elsewhere.
I am writing a VB.NET...
|
by: huseyinakturk |
last post by:
Hi,
I am trying to send mail using Outlook component in C# code. But I am
getting errors. First error is,
Exception Details: System.UnauthorizedAccessException: General access
denied
error
...
|
by: isurug |
last post by:
Hello All!
I've been trying to come up with a web service which enables me to use
outlook remotly with a machine which only has a web browser. I've tried
this with windows forms and it worked...
|
by: mwolowski |
last post by:
Hello,
I'd like to add tasks, appointments, etc using c# to outlook
For example i added reference
using OutLook = Microsoft.Office.Interop.Outlook;
and the code:
1.
---------------------...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |