473,396 Members | 1,722 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,396 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 2215
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...
0
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.