473,386 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How do I use C# to access an Outlook inbox (not my default inbox)?

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 "MonthlySales".
I thought that I could just log into the server with a different session:

Expand|Select|Wrap|Line Numbers
  1.   profileInfo = (object)string.Format("{0}\n{1}", MailServer, UserName);
  2.  
  3.   ns.Logon(profileInfo, Missing.Value, false, true);
  4.   string name = ns.CurrentUser.Name;
  5.   inboxFolder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
  6.  
  7.  
When this code runs:

- Username and MailServer are correct.
- profileInfo is correct

- ns.Logon(...) runs without error...

- "name" still shows MY logged in username
- "inboxFolder" still points to MY local inbox folder.

How do I log into the "MonthlySales" email account so that I can access it programatically?
Aug 12 '10 #1
0 1172

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Paul | last post by:
I am using a windows service which accesses Microsoft Outlook. Outlook is supposed to send an email. This works fine when not run in a windows service. I am running the service under my user...
1
by: Iain Miller | last post by:
Currently using & developing a new application in A97. This app has a lot of Name & Address information in it. A lot of that information will be duplicated in Outlook & I suddenly wondered if its...
4
by: PerryC | last post by:
All, How to ensure SendObject open Outlook and Not Outlook Express? Most pc here at work will default to open OL but on one pc, it open up OL Express. How to fix this in the code? P.S.: I...
3
by: Strasser | last post by:
In Access2000 mass emailing worked perfectly (very powerful tool!). Doesn't work when using XP version of both Access and Outlook, even though I checked the box to ensure that I was sending the...
6
by: TomislaW | last post by:
Is it possible to access outlook expres mail, with dot net?
5
by: Jacobus Terhorst | last post by:
Are there any ASP.NET 2.0 newsgroups available through Outlook Express (not web based)?
2
by: Alban | last post by:
Hello My soft gets back information from outlook. But when I create my namespace: OApp = New Outlook.Application oNS = oApp. Session oNS.Logon (Nothing, Nothing, False, True) I have an...
2
by: mnarewec | last post by:
The type or namespace name 'OutLook' could not be found (are you missing a using directive or an assembly reference?) Actually I am trying to follow an example shown in the article: ...
0
by: spoorthisri | last post by:
Hi All, Please how to access outlook express in C#.NET. I need to read the attachment from outlook express in C#.NET. and delete the mails move the mails from outlook express. Regards,...
1
by: robnoper | last post by:
XP SP2, access and outlook 2003 I have a form with 3 command buttons on that when one is pressed it opens up a html email for the user to send. Two of the emails work fine and open with the full...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.