I have read through this post, and found many like it.
My problem is that the email inbox that I am trying to access is not my default inbox.
There is a mail account that receives emails from a reporting site. The email account is "MonthlySal es".
I thought that I could just log into the server with a different session:
When this code runs:
- Username and MailServer are correct.
- profileInfo is correct
- ns.Logon(...) runs without error...
- "name" still shows MY logged in username
- "inboxFolde r" still points to MY local inbox folder.
How do I log into the "MonthlySal es" email account so that I can access it programatically ?
My problem is that the email inbox that I am trying to access is not my default inbox.
There is a mail account that receives emails from a reporting site. The email account is "MonthlySal es".
I thought that I could just log into the server with a different session:
Code:
profileInfo = (object)string.Format("{0}\n{1}", MailServer, UserName);
ns.Logon(profileInfo, Missing.Value, false, true);
string name = ns.CurrentUser.Name;
inboxFolder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
- Username and MailServer are correct.
- profileInfo is correct
- ns.Logon(...) runs without error...
- "name" still shows MY logged in username
- "inboxFolde r" still points to MY local inbox folder.
How do I log into the "MonthlySal es" email account so that I can access it programatically ?