Read Exchange 2003 Mailbox

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Does anyone have an example of how to read Exchange 2003 email box in C#
without have to install Outlook or any other client, no pop3 either?


Thank You



Peter
 
Hello Peter,

Thanks for using Microsoft Newsgroup Support Service, my name is Colbert
Zhou [MSFT] and I will be working on this issue with you.

We need to use the WebDAV to read exchange 2003 emails. There is a sample
project in the codeproject site,
http://www.codeproject.com/KB/vb/AccRemoteExchange.aspx

And you can find the official documents about the WebDAV in the following
link,
http://msdn.microsoft.com/en-us/library/aa143161.aspx

You can also get helps from the Exchange Development Newsgroup on the
WebDAV issues,
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=micros
oft.public.exchange.development&cat=en_US_cb82930f-c38e-4fe3-a24f-534759d0f4
dd&lang=en&cr=US

Have a nice day!


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
 
Hello Peter,

Thanks for using Microsoft Newsgroup Support Service, my name is Colbert
Zhou [MSFT] and I will be working on this issue with you.

We need to use the WebDAV to read exchange 2003 emails. There is a sample
project in the codeproject site,
http://www.codeproject.com/KB/vb/AccRemoteExchange.aspx

And you can find the official documents about the WebDAV in the following
link,
http://msdn.microsoft.com/en-us/library/aa143161.aspx

You can also get helps from the Exchange Development Newsgroup on the
WebDAV issues,
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=micros
oft.public.exchange.development&cat=en_US_cb82930f-c38e-4fe3-a24f-534759d0f4
dd&lang=en&cr=US

Have a nice day!


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
 
Hello Colbert Zhou [MSFT],

There is even a commercial library that abstracts this for you, making it
even simpler to use.

http://www.independentsoft.de/webdavex/index.html

I used it in the past and can reccommend it.

Jesse
Hello Peter,

Thanks for using Microsoft Newsgroup Support Service, my name is
Colbert Zhou [MSFT] and I will be working on this issue with you.

We need to use the WebDAV to read exchange 2003 emails. There is a
sample project in the codeproject site,
http://www.codeproject.com/KB/vb/AccRemoteExchange.aspx

And you can find the official documents about the WebDAV in the
following
link,
http://msdn.microsoft.com/en-us/library/aa143161.aspx
You can also get helps from the Exchange Development Newsgroup on the
WebDAV issues,
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=
micros
oft.public.exchange.development&cat=en_US_cb82930f-c38e-4fe3-a24f-5347
59d0f4 dd&lang=en&cr=US

Have a nice day!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments
and suggestions about how we can improve the support we provide to
you. Please feel free to let my manager know what you think of the
level of service provided. You can send feedback directly to my
manager at: (e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notificati
ons.
 
Hello Colbert Zhou [MSFT],

There is even a commercial library that abstracts this for you, making it
even simpler to use.

http://www.independentsoft.de/webdavex/index.html

I used it in the past and can reccommend it.

Jesse
Hello Peter,

Thanks for using Microsoft Newsgroup Support Service, my name is
Colbert Zhou [MSFT] and I will be working on this issue with you.

We need to use the WebDAV to read exchange 2003 emails. There is a
sample project in the codeproject site,
http://www.codeproject.com/KB/vb/AccRemoteExchange.aspx

And you can find the official documents about the WebDAV in the
following
link,
http://msdn.microsoft.com/en-us/library/aa143161.aspx
You can also get helps from the Exchange Development Newsgroup on the
WebDAV issues,
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=
micros
oft.public.exchange.development&cat=en_US_cb82930f-c38e-4fe3-a24f-5347
59d0f4 dd&lang=en&cr=US

Have a nice day!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments
and suggestions about how we can improve the support we provide to
you. Please feel free to let my manager know what you think of the
level of service provided. You can send feedback directly to my
manager at: (e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notificati
ons.
 
How do I determen if an email has an attachment in the following code?


using System;
using System.Xml;
using System.Xml.Xsl;
using MSXML2;

MSXML2.ServerXMLHTTP40Class oXmlHttp = new ServerXMLHTTP40Class();
System.Xml.XmlDataDocument xmlDOMParams = new XmlDataDocument();
MSXML2.DOMDocument40Class xmlDOMParamsAttachment = new DOMDocument40Class();

XmlNodeList xmlNdLstDonation;

oXmlHttp.open("PROPFIND", mailBox, false, user, password);
oXmlHttp.setRequestHeader("Depth", "1");
oXmlHttp.setRequestHeader("Content-type", "xml");
oXmlHttp.send("");

string str = oXmlHttp.responseText;
xmlDOMParams.LoadXml(str);

xmlNdLstDonation = xmlDOMParams.GetElementsByTagName("e:to");

string to = "<[email protected]>";

foreach (XmlNode xn in xmlNdLstDonation)
{
if (xn.InnerText.ToLower().IndexOf(to) > -1)
{
//
// how do I determine if this email has an attachment
//
}
}
 
How do I determen if an email has an attachment in the following code?


using System;
using System.Xml;
using System.Xml.Xsl;
using MSXML2;

MSXML2.ServerXMLHTTP40Class oXmlHttp = new ServerXMLHTTP40Class();
System.Xml.XmlDataDocument xmlDOMParams = new XmlDataDocument();
MSXML2.DOMDocument40Class xmlDOMParamsAttachment = new DOMDocument40Class();

XmlNodeList xmlNdLstDonation;

oXmlHttp.open("PROPFIND", mailBox, false, user, password);
oXmlHttp.setRequestHeader("Depth", "1");
oXmlHttp.setRequestHeader("Content-type", "xml");
oXmlHttp.send("");

string str = oXmlHttp.responseText;
xmlDOMParams.LoadXml(str);

xmlNdLstDonation = xmlDOMParams.GetElementsByTagName("e:to");

string to = "<[email protected]>";

foreach (XmlNode xn in xmlNdLstDonation)
{
if (xn.InnerText.ToLower().IndexOf(to) > -1)
{
//
// how do I determine if this email has an attachment
//
}
}
 
Hello Peter,

We need to use the X-MS-ENUMATTS method to enumerate the attachments of an
email message,

You can view the following MSDN document for a sample,
http://msdn.microsoft.com/en-us/library/ms877930(EXCHG.65).aspx


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Hello Peter,

We need to use the X-MS-ENUMATTS method to enumerate the attachments of an
email message,

You can view the following MSDN document for a sample,
http://msdn.microsoft.com/en-us/library/ms877930(EXCHG.65).aspx


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Thank you, that works great!

I have one more problem

The following code works fine when I run it as Console application, but when
I run the same code inside Windows Service program I am getting the
following error on this line "oXmlHttp.send(null); "

System.Runtime.InteropServices.COMException (0x80072EEF): Exception from
HRESULT: 0x80072EEF
at MSXML2.ServerXMLHTTP40Class.send(Object varBody)


Here's the code:

MSXML2.ServerXMLHTTP40Class oXmlHttp = new ServerXMLHTTP40Class();

oXmlHttp.open("PROPFIND", mailBox, false, user, password);
oXmlHttp.setRequestHeader("Depth", "1");
oXmlHttp.setRequestHeader("Content-type", "xml");
oXmlHttp.send(null); // <-- This is where the error occurs


Or is there a better way of getting list of emails from the Inbox?
 
Thank you, that works great!

I have one more problem

The following code works fine when I run it as Console application, but when
I run the same code inside Windows Service program I am getting the
following error on this line "oXmlHttp.send(null); "

System.Runtime.InteropServices.COMException (0x80072EEF): Exception from
HRESULT: 0x80072EEF
at MSXML2.ServerXMLHTTP40Class.send(Object varBody)


Here's the code:

MSXML2.ServerXMLHTTP40Class oXmlHttp = new ServerXMLHTTP40Class();

oXmlHttp.open("PROPFIND", mailBox, false, user, password);
oXmlHttp.setRequestHeader("Depth", "1");
oXmlHttp.setRequestHeader("Content-type", "xml");
oXmlHttp.send(null); // <-- This is where the error occurs


Or is there a better way of getting list of emails from the Inbox?
 
Hello,

Sorry for following up late!

Since it works in the console application, but not the windows service
application, have you tried to configure the windows service run in your
normal account, instead of Local System?

By the way, since this is totally a exchange dev issue, I recommend you
raise it in the more appropriate newsgroup, so that more experts on this
field can give help,
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=micros
oft.public.exchange.applications&cat=en_US_c8ebd5a7-f6c6-4580-bc36-cab530c01
be0&lang=en&cr=US

Have a nice day!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Hello,

Sorry for following up late!

Since it works in the console application, but not the windows service
application, have you tried to configure the windows service run in your
normal account, instead of Local System?

By the way, since this is totally a exchange dev issue, I recommend you
raise it in the more appropriate newsgroup, so that more experts on this
field can give help,
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=micros
oft.public.exchange.applications&cat=en_US_c8ebd5a7-f6c6-4580-bc36-cab530c01
be0&lang=en&cr=US

Have a nice day!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
Back
Top