MickyMc
asked on
C# Connect to Outlook
Hi all,
I am connecting to outlook using the Interop.Outlook namespace. The issue I have is that no matter what I put in on the login, it still logs me in ahhhh
I have the following code..
The ns.logon still works. I want to be able to specify the mail server and the user to login as./.. any idea's  thanks M
I am connecting to outlook using the Interop.Outlook namespace. The issue I have is that no matter what I put in on the login, it still logs me in ahhhh
I have the following code..
Outlook.Application outlook = new Outlook.ApplicationClass();
Outlook.NameSpace ns = outlook.GetNamespace("Mapi");
object _missing = Type.Missing;
//ns.Logon(_missing, _missing, true, true);
ns.Logon("UserDoesntExist", "Password", false, true);
Outlook.MAPIFolder inbox = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
int unread = inbox.UnReadItemCount;
The ns.logon still works. I want to be able to specify the mail server and the user to login as./.. any idea's  thanks M
ASKER
thanks Fridom.. good link... actually mentioned the fix for another issue I had but I put in the same fix they had.
I just need to know why the login ignore what I put into the name and password. I would like to specify a server, a username and password to access email boxes... any ideas anyone
I just need to know why the login ignore what I put into the name and password. I would like to specify a server, a username and password to access email boxes... any ideas anyone
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
no help from the experts so had to go figure myself
http://msdn.microsoft.com/en-us/library/aa289167%28VS.71%29.aspx