logging in to outlook programatically

M

Mike P

I am using the code below to logon to the local Outlook account. But
what I need to do is be able to login without explicitly stating the
userlogin and password. Is it possible to pass the windows
authentication details to the logon method and it will automatically
logon to Outlook, without explicitly stating them (i.e. by passing
something along the lines of System.Environment.UserName and
System.Environment.Password)?

Outlook.Application oApp = new Outlook.Application();

//Get MAPI namespace
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");


oNS.Logon("username, "password", false, true);
 
S

shashank kadge

I am using the code below to logon to the local Outlook account. But
what I need to do is be able to login without explicitly stating the
userlogin and password. Is it possible to pass the windows
authentication details to the logon method and it will automatically
logon to Outlook, without explicitly stating them (i.e. by passing
something along the lines of System.Environment.UserName and
System.Environment.Password)?

Outlook.Application oApp = new Outlook.Application();

//Get MAPI namespace
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");

oNS.Logon("username, "password", false, true);

*** Sent via Developersdexhttp://www.developersdex.com***

try this

System.Security.Principal.WindowsIdentity.GetCurrent().Name


-
shashank kadge
 

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