473,804 Members | 3,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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:

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
- "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 ?
Aug 12 '10 #1
0 1188

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

Similar topics

1
3057
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 domain logon. I am using VB.net and using redemption.dll to bypass the security patch. This is the line of code that causes the event error Dim olApp As New Outlook.Application When I try and use a service the following error occurs.
1
4069
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 possible under the newer versions of Office to use the information already stored in Outlook as part of an Access database project. The logic being that the data could then be held in one place rather than two. This is a customer & order management...
4
398
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 thought I posted this yesterday, but somehow I did not see the post myself. Sorry, if I double post.
3
2371
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 email. Any ideas? Thanks in advance.
6
1248
by: TomislaW | last post by:
Is it possible to access outlook expres mail, with dot net?
5
1325
by: Jacobus Terhorst | last post by:
Are there any ASP.NET 2.0 newsgroups available through Outlook Express (not web based)?
2
1190
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 error: "Outlook is not running. Run it first."
2
8881
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: http://support.microsoft.com/kb/895940 but its giving the above error eventhought I add the Reference Microsoft Outlook 11.0 Object library. I am using VS 2005 Professional Edition. Here is my code:
0
987
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, Spoorthi
1
4593
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 colour and size formatted text but one of them just shows the html code in the body with no formatting. The vba code for the command button is as follows: Private Sub cmdUpdateEmail_Click() Dim HTMLReminderEmail As String Dim Subject As String...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.