473,378 Members | 1,138 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Problem on Opening OutLook Express using ASP.NET

sivisr
17
Hi,
i am using the following code to open outlook Express to send mail ,but i get

" System.UnauthorizedAccessException: Access is denied. at WebApplication7.WebForm9.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication7\outlookfrm.aspx .cs:line 57 " this error.

My code:
Outlook._Application app = null;
Outlook._NameSpace nameSpace = null;
Outlook.MailItem memo = null;
Outlook.MAPIFolder outbox = null;
try
{
app = new Outlook.ApplicationClass();
nameSpace = app.GetNamespace("MAPI");
nameSpace.Logon(null,null,false, false);
outbox = nameSpace.GetDefaultFolder(Outlook.OlDefaultFolder s.olFolderDrafts);
memo = (Outlook.MailItem)app.CreateItem(Outlook.OlItemTyp e.olMailItem);
memo.To = "wf.tl@recordsanddata.com";
memo.Subject = "TechRepublic.com Test";
memo.Body = "Hello there";
memo.SaveSentMessageFolder = outbox;
memo.Send();
}
catch(System.Exception ex)
{
Response.Write(ex.ToString());
}

Any Body Please give me any suggesion or any other option for opening outlook.
Jul 26 '07 #1
2 1883
radcaesar
759 Expert 512MB
In Which account you are running your application ? An account with admin rights ?

Means, did you make Impersonate to TRUE in web.config file and with a valid Domain Username and Password ?
Jul 26 '07 #2
sivisr
17
ya every thing is good but there is a problem in out look,its is not opening in my system.

thank you
Aug 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Wayne Wengert | last post by:
I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I want to display a list of all tables in an Access database. I want to put that list of table names in a listbox so the user...
5
by: Zack | last post by:
I am totally new to microsoft technolgy so please bear with me. All i want to do is to open an email client software tool (outlook or outlook express) from inside my application so that people...
10
by: jand187 | last post by:
Hi, I need to open an email in outlook (exchange) with most of the fields filled out and a file attached. I don't want to send the mail right away as the user must be able to edit the body text....
0
by: Danish | last post by:
Hi all, I am trying to open outlook express along with an attachment. I have added a reference to the Microsoft outlook Library I am using the following lines of code....
2
by: lee.ottaway | last post by:
Hi My VB.NET software is simply keeping a reference to certain EML file locations created by Outlook Express. When a user double-clicks a specific EML file from my grid, I'd like Outlook...
6
by: Bernhard Straub | last post by:
Hi, using vb .NET 2003 I am trying to open the standard mail client. The mail window should open and the user should be able to choose the recipient, add some text to the mail etc. Using...
26
by: Tom Becker | last post by:
Is there a way, from Access, to programmatically click the Send and Receive button in Outlook?
1
VijaySofist
by: VijaySofist | last post by:
Hi! I want to attach a file to the Outlook Express through VB6 coding and open that open that outlook express window to send the mail. If anybody Knows, please reply me. Thanks in Advance ...
0
by: dharmesh1810 | last post by:
dear all, i have developed program in VB6 as front end + SQL Server as back end + Crystal Report as Reporting Tools and vsflex grid as third party tools. program is running fine, my problem is...
0
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...
0
isladogs
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.