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

G

Guest

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.OlItemType.olMailItem);
oMailItem.To = someId;

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

Nick Malik [Microsoft]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top