N
Nagina Eliav
Hello
I have problem to connect to Outlook from Nt Service
i am using following code in c#
Outlook.Application oApp=new Outlook.ApplicationClass();
Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI");
MAPI.Session oSession = new MAPI.SessionClass();
Outlook.ContactItem oContact=null;
oSession.Logon(Missing.Value , Missing.Value, Missing.Value, true,
Missing.Value, Missing.Value, "server" + "\n" + "username" );
oNameSpace.Logon(oSession.Name ,Missing.Value ,Missing.Value ,true);
(Outlook.MAPIFolder )oContactsFolder =
(Outlook.MAPIFolder)oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders
.olFolderContacts);
this code successfully running in application
but as Nt service i got following error
Error description:
System.Runtime.InteropServices.COMException (0x84140111): The server is
not available. Contact your administrator if this condition persists.
at Outlook.NameSpaceClass.Logon(Object Profile, Object Password,
Object ShowDialog, Object NewSession)
Is anyone knows why this error happends when it runs as service?
thanks
Nagina
I have problem to connect to Outlook from Nt Service
i am using following code in c#
Outlook.Application oApp=new Outlook.ApplicationClass();
Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI");
MAPI.Session oSession = new MAPI.SessionClass();
Outlook.ContactItem oContact=null;
oSession.Logon(Missing.Value , Missing.Value, Missing.Value, true,
Missing.Value, Missing.Value, "server" + "\n" + "username" );
oNameSpace.Logon(oSession.Name ,Missing.Value ,Missing.Value ,true);
(Outlook.MAPIFolder )oContactsFolder =
(Outlook.MAPIFolder)oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders
.olFolderContacts);
this code successfully running in application
but as Nt service i got following error
Error description:
System.Runtime.InteropServices.COMException (0x84140111): The server is
not available. Contact your administrator if this condition persists.
at Outlook.NameSpaceClass.Logon(Object Profile, Object Password,
Object ShowDialog, Object NewSession)
Is anyone knows why this error happends when it runs as service?
thanks
Nagina