There is a property of type bool for MessageType called isRead. The first time a mail comes to the inbox, we show it in bold because it is not read yet, but when the mail is read, we need to set the property isRead to true so that the next time we show it as normal. After successfully reading a mail, we need to update this property to true. We have an API UpdateItem to update any existing item. The code to accomplish this is as shown:

Extended properties are very important for us when we make custom mail applications because, let's say, in a mail, we have default properties in the MessageType item, and if we want a new property, let's say, Classification, for our custom application, then we need to use an extended property.

Share

About the Author

Brij is a 3-times Microsoft MVP in ASP.NET/IIS Category and a passionate .NET developer. More than 6 years of experience in IT field, currently serving a MNC as a Tech Lead/Architect.

He is a very passionate .NET developer and have expertise over Web technologies like ASP.NET 2.0/3.5/4.0, jQuery, JSON, Javascript, IIS and related technologies. He is also a Exchange Server (EWS) Specialist. He has great experience in design patterns and N-Tier Architecture.

He is also certified as Microsoft Certified Technologies Specialist-ASP.NET and Microsoft Certified Technologies Specialist-WCF in .NET 4.0. He has also received several awards at various forums and his various articles got listed as "Article of the day" at ASP.NET Microsoft Official Website www.asp.net.

He has done MCA from NIT Durgapur and completed his graduation from Lucknow University.

Comments and Discussions

I am using EWS to find emails, but struggling to find a way to parse the reply text from the body of the email. Is there an easy way to do so in EWS? This is for internal use so all incoming emails are coming from Outlook 2007 or Outlook 2010 or OWA.

Hi - Thanks for sharing your knowledge. I have a problem that I am unable to resolve. Please see my code - I am basically unable to mark messages as Read after I go through the new messages in Inbox and write them to a database. I would appreciate any help. Thanks you so much!

Here is my code:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

foreach (Item item in inboxResults)
{
Item working = Item.Bind(service, item.Id, ps);
}
// I have code here that writes messages to a db
// Here is what I need code to mark the above messages in Exchange as Read

In the function SetReadStatus of my article, I am passing a parameter item of class ItemIdType, It has two properties one is Id and another is ChangeKey.Whenever we just want to read any item from xchamge server <code>Id</code> is enough, but if we want to update some item in exchange the we require tp provide both <code>Id</code> and <code>ChangeKey</code>.As here we are updating an Item in server we need both to provide as you can see in my function I have also provided, as((ItemIdType)updatedItems[0].Item).Id = item.Id;
((ItemIdType)updatedItems[0].Item).ChangeKey = item.ChangeKey;

Exchange Server can bulk voice mail and e-mail into your inbox using UM.

The voice mails have a distinct format allowing you to do multiple things one of which is distinquish itself from e-mails.

I'm trying to take a voice mail from a seperate service and send it to the exchange server. Right now it just looks like an e-mail with a .wav file attached when it reaches Outlook.

I can intercept the e-mail as an SMTP message with a .wav file attached. Is there a way I could then create a message out of the data I parse from that, manipulate it into the voice mail format, and send it to the exchange server? If so, would it then look and act like an exchange voice mail?

Here you want the details of an Item. right?
In EWS, every item is identified by an ID which is an object of ItemIdType.You must have the Id of an item for which you want to have details.So provide the ItemId of the Mail.

I have not tried this.there are few properties that can be used to check whether a mail is forwarded or replied.I'll try to explore it and let you know in themeantime you can also try.
One another way you can have you own extended property which keeps a flag whther a mail is forwarded or not.

Ir has nothing to do with the sample codes.Loading of messages is very slow may be cause of different scenario like:
-Your server/machine are very slow
-Bad design of your project
-Your pages are too heavy
So I am suggesting you to go through the following links.These will help you a lot regarding the performance.Click hereClick here2

Also check your hardware configuration and all the processes running on the machine..

i am have little problem in reading the body of the email. is it possible to just get the text message instead of whole HTML. while looping through the the emails some time i get plan text and other time i am getting HTML

Actually its upto the sender, in which format he/she wants send the email whether text or html.And the message body contains the same format.So it can not be controlled at the recieving site.It just like, in which format your system allows to send the email if it is in both format then you would be the same .Else you can restrict your application to send the mail in text format only.
Hope it helps

-- what is idType in the GetSignalDetails function?
-- where did you initialise myMessage variable?
-- what is objSignalDetailsRow (init, type)?
-- Why should reader understand by telepathic your errors handling without your comments?
-- Is 'messagetype' in your code MessageType in original?