472,954 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

sending mail using Outlook and vc#.net with object library 9.0

Hi all!

I am trying to send mail using outlook in my web application. i am using
Outlook Express. Actually i am saving it in DRAFTS folder instead of sending
it. My system are in network. I hard coded my outlook login profile. Its
working fine as far as running the application in that particular system
i.e., where i was developing the Application. But when i am trying to run it
on remote system i.e., using system name or IP address, its giving error
like, access denied.

I gave impersonate=true in web.config file of the solution.
Plz help me in this regard.

some code that i am using

oApp = new Outlook.Application();
oNameSpace= oApp.GetNamespace("MAPI");
oNameSpace.Logon("myOutllokID","myPassword",false, true);
Outlook._MailItem oMailItem =
(Outlook._MailItem)oApp.CreateItem(Outlook.OlItemT ype.olMailItem);
oMailItem.To = someId;

oMailItem.CC=someOthersID;
oMailItem.Subject = "something:";
oMailItem.HtmlBody = someHtmlSource;
oMailItem.Save();

Jul 22 '05 #1
1 2191
Kind of an odd thing to do. Why not just use System.Web.Mail to send your
e-mail from the web app?

http://www.systemwebmail.com/

This is far and away the most common way to send mail from a web app, and
you will get a lot more support from various folks to get past your
problems.

Note that many web servers will not support MAPI calls like the one in your
code below. Do you plan to host your web app on something other than a
client machine?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Hari" <Ha**@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
Hi all!

I am trying to send mail using outlook in my web application. i am using
Outlook Express. Actually i am saving it in DRAFTS folder instead of
sending
it. My system are in network. I hard coded my outlook login profile. Its
working fine as far as running the application in that particular system
i.e., where i was developing the Application. But when i am trying to run
it
on remote system i.e., using system name or IP address, its giving error
like, access denied.

I gave impersonate=true in web.config file of the solution.
Plz help me in this regard.

some code that i am using

oApp = new Outlook.Application();
oNameSpace= oApp.GetNamespace("MAPI");
oNameSpace.Logon("myOutllokID","myPassword",false, true);
Outlook._MailItem oMailItem =
(Outlook._MailItem)oApp.CreateItem(Outlook.OlItemT ype.olMailItem);
oMailItem.To = someId;

oMailItem.CC=someOthersID;
oMailItem.Subject = "something:";
oMailItem.HtmlBody = someHtmlSource;
oMailItem.Save();

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
3
by: Kory Pukash | last post by:
Our application is built in asp.net and we are looking for a way to send an e-mail notification (via exchange). We have gotten the System.Web.Mail to send an e-mail, but we need the e-mail written...
13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
26
by: Massimo Zaccarin | last post by:
ok, I know that I have to use the System.Web.Mail.SmtpMail class, but I've read from...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
2
by: Roger | last post by:
I am creating an application that will sit on a client pc and monitor the inbox. When an e-mail enters the inbox, then an even will be fired and I will then be able to process the mail. I have...
0
by: JohnB | last post by:
Hi I am trying to send an email throw Outlook Object Model and i receive the error : "File or assembly name Interop.Outlook, or one of its dependencies, was not found." I add Microsoft Outlook...
1
by: Hari | last post by:
Hi all! I am trying to send mail using outlook in my web application. i am using Outlook Express. Actually i am saving it in DRAFTS folder instead of sending it. My system are in network. I hard...
6
by: Rushwire | last post by:
Does anybody know how to send a meeting request using an ics/vcs (VCalendar) attachment from an asp.net page. I don't want my users to have to double click on the attachment but rather that it is...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.