Connecting to Exchange mailbox from client machine using OOM

T

tanutatu

Hi

We are using Outlook 2003 and above & Exchange Server 2003

Is it possible to enumerate messages in an exchange mailbox using
Outlook Object Model(c#), from a client machine(not containing
exchange, but containing Outlook) ?
Also is it possible to do the above without opening Outlook.?

Can someone please provide some links to refer to for the same.

We are aware that it can be done using Ex-Mapi/CDO.

Thanks !

Regards,
TT
 
S

Sue Mosher [MVP-Outlook]

You'd have to at least start Outlook, but you would not need to display any UI to the user. What's the application?
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
T

tanutatu

Thanks Sue !

Basically, one of the features of our product is to run thru the
Exchange MailBox and look for new mails on server and dispaly
notification on the user's desktop even before he has opened the
Outlook UI.
I tried the method you suggested, but it seems to only display messages
downloaded from server.
Following is the code snippet :
///start of snippet////////////////////
private void ListMessages()
{
string strMesgs = "";
Microsoft.Office.Interop.Outlook._Application ol =
new Microsoft.Office.Interop.Outlook.ApplicationClass();
Microsoft.Office.Interop.Outlook._NameSpace olns =
ol.GetNamespace("MAPI");
olns.Logon("Mapi Profile" , "" , 0, 0);
Outlook.MAPIFolder inbox =
olns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Items unreadMailItems = inbox.Items;
foreach (Object omailItem in unreadMailItems)
{
Outlook.MailItem unreadMailItem =omailItem as Outlook.MailItem;
strMesgs+=unreadMailItem.SenderName + "\n";
}
MessageBox.Show(strMesgs,"New Mails:");
}

////end of snippet///////////////////////

Can you please pin point what changes i need to do for gettign "new"
mails present on Exchange Server but noy yet downloaded to the client
machine?
Also is there a way to supress the Security Prompt that appears when u
try the above method...?

regards
TT
 
S

Sue Mosher [MVP-Outlook]

If you want to talk directly to the server mailbox, don't use the Outlook object model, use WebDAV; see http://msdn.microsoft.com/exchange/

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Top