473,791 Members | 3,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connecting to Outlook from C#

8 New Member
Hi All,
I've written code that connects to Outlook and retrieves emails from a folder that resides inside my inbox. My profile is on Exchange Server.

Expand|Select|Wrap|Line Numbers
  1. Outlook._Application olApp = new Outlook.ApplicationClass();
  2. Outlook._NameSpace olNS = olApp.GetNamespace("MAPI");
  3. olNS.Logon("****", "****", true, true);
  4.  
  5. Outlook.MAPIFolder newFolder = olNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
  6.  
This works fine on my local machine. However, I want to be able to get to my inbox from any machine. Would anyone know how to modify the above code or use different method of connecting to my inbox from a machine other than my own?

Thanks,
S
May 31 '07 #1
1 1930
TRScheel
638 Recognized Expert Contributor
Hi All,
I've written code that connects to Outlook and retrieves emails from a folder that resides inside my inbox. My profile is on Exchange Server.

Expand|Select|Wrap|Line Numbers
  1. Outlook._Application olApp = new Outlook.ApplicationClass();
  2. Outlook._NameSpace olNS = olApp.GetNamespace("MAPI");
  3. olNS.Logon("****", "****", true, true);
  4.  
  5. Outlook.MAPIFolder newFolder = olNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
  6.  
This works fine on my local machine. However, I want to be able to get to my inbox from any machine. Would anyone know how to modify the above code or use different method of connecting to my inbox from a machine other than my own?

Thanks,
S

After my run of luck with exchange, i would believe you would need to use RPC over HTTP.... though thats just from past experience, not from any technical knowledge
May 31 '07 #2

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

Similar topics

2
19348
by: Fritz Switzer | last post by:
Can anyone provide a small snippet in C# that pulls out the Contacts in Outlook XP. I've seen a couple of examples in C++ and VB in previous newsgroup posts, but either the originals didn't work or my conversion skills are weak. And if I have to use tlbimp.exe what is the right file to use. Thanks for the help. -- Fritz
0
1180
by: Bob Bykerk | last post by:
Hi guys, I am integrating the outlook inbox into a personnel database and have successfully linked the table. I can see where an e-mail has attachments, but can't get to them. Has anyone done this using VBA ? Cheers, Bob
2
3207
by: Dhans | last post by:
I am new to Outlook programming. I want to access outlook from my C# application and get the information such as contacts, mails, appointments etc I can able to connect to outlook using Microsoft.outlook11 com libraries, I am getting a security message as below, "A program is trying to access e-mail address you have stored in outlook. Do you want to allow this?" "If this is unexpected, it may be a virus and you should choose no" "Allow...
12
2795
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed both the iis and sql server in a single machine. Not too long ago, the machine had some hardware problems, and management has decided to purchase new servers, for both asp.net and sql server.
9
6747
by: Srinivas | last post by:
hi all how to access the outlook user profiles through VB.net any help.... thanks in advanc Srinivas
3
1174
by: michael.bollhoefer | last post by:
I am trying to mimick the actions of programs such as TRACKIT that will allow users to send an e-mail to a helpdesk@companyname.com address and put the information into a SQL table. I am using exchange server and a SQL database. For example if Joe Blow sends me a message it would add a new record in the SQL table that automatically created a work order number, put his name as the requestor, and put the message body into a text field...
0
1271
by: Rico | last post by:
Hello, Does anyone have experience connecting to an Outlook PST file or Exchange Server database using a distributed database? I'm trying to access Contacts, Inbox and Sent Items information, but each client and client site has a different email set up. For instance, One client site up North operates in a stand alone environment using Outlook PST files and no network server. While others use a server based PST file, others use...
0
1376
by: envywaits | last post by:
I need some help connecting my MS-Access 2003 database with a contacts list on MS-Exchange Server 2003. I can get the default field list (using the wizard) but I cannot seem to get any of the other fields. I've tried modifying the schema.ini file with poor to limited results. I've tried using MDBVU32 and MfcMapi.exe in an effort to get field names but these tools don't seem to give me anything I can use to help with the schema.ini...
5
9338
by: =?Utf-8?B?TWFya1NraQ==?= | last post by:
For about a month now, I have had trouble with Outlook Express. When logging in to Outlook Express, I get an error message stating that the connection to server has failed. My internet connection works (same server), but Outlook Express is unable to connect. If I restart the computer, Outlook Express will then be able to connect; so eventually I can use it but I must reboot every time. I have checked with my ISP and they say there is no...
0
9666
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
9512
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
10419
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...
0
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
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,...
0
9023
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6770
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
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.