By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,024 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,024 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.