I try this code :
Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
mapiNameSpace.Logon(null, null, false, false);
mapiNameSpace.Logon("MyEmailID", "PasswordOfMyEmail", Missing.Value, true);
Microsoft.Office.Interop.Outlook.MAPIFolder myInbox = mapiNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
MessageBox.Show(myInbox.Items.Count + "");
But the MessageBox display me 0 (myInbox.Items.Count).
So maybe I am not able to access my outlook account !!!
I use Visual Studio 2010.
Can someone help me please ?