471,330 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 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 2103
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Sven Templin | last post: by
13 posts views Thread by joe215 | last post: by
26 posts views Thread by Massimo Zaccarin | last post: by
reply views Thread by rosydwin | last post: by

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.