Error listing Exchange reply messages

Last post 03-02-2011, 6:29 PM by aspose.notifier. 10 replies.
Sort Posts: Previous Next
  •  01-07-2010, 10:42 AM 216051

    Error listing Exchange reply messages .NET

    Hi.

    I'm trying to list mail messages from  my Inbox mailbox (Exchange 2007).
    I can list most of my e-mails using the "ExchangeClient.ListMessages(MailBoxURI)" but Exchange reply messages like "Read receipts" or "incorrect addresses" are not listed. How can I list this kind of e-mails?

    Aspose.Network.dll version is 4.8.0.5.


     
  •  01-08-2010, 12:12 PM 216261 in reply to 216051

    Re: Error listing Exchange reply messages

    Hi,

    Thanks for considering Aspose.

    Could you please use the following code snippet to get delivery receipts using the ExchangeClient class:

    ExchangeClient client = new ExchangeClient("mailboxuri", "username", "password");
                ExchangeMailboxInfo mailbox = client.GetMailboxInfo();
                string folderenc = HttpUtility.HtmlEncode(mailbox.InboxUri);
                const string
                shallowFormatString = "SELECT \"DAV:contentclass\""
                 + ",\"urn:schemas:mailheader:subject\""
                 + ",\"urn:schemas:mailheader:from\""
                 + ",\"urn:schemas:mailheader:to\""
                 + ",\"urn:schemas:mailheader:cc\""
                 + ",\"urn:schemas:mailheader:message-id\""
                 + " FROM SCOPE"
                 + "('shallow traversal of \"{0}\"')"
                 + " WHERE "
                    //+ "\"DAV:contentclass\" = 'urn:content-classes:message' ";
                 + "\"http://schemas.microsoft.com/exchange/outlookmessageclass\" = 'REPORT.IPM.Note.NDR' "; //only get the dns messages
                string query = string.Format(shallowFormatString, folderenc);

                try
                {
                    ExchangeMessageInfoCollection messages = client.ListMessages(mailbox.InboxUri, query);
                    Console.WriteLine("Count is " + messages.Count);
                    foreach (ExchangeMessageInfo message in messages)
                    {
                        Console.WriteLine(message.Subject);
                    }
                }
                catch (ExchangeException ex)
                {
                    Console.WriteLine(ex.ToString());
                }

    We will do some research at our end to provide some easy/alternate method to get read receipts.

    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
  •  01-11-2010, 3:33 AM 216397 in reply to 216261

    Re: Error listing Exchange reply messages

    Thanks for the reply.

    I already try the given code snippet and the error persists. Is it because my Exchange Server accounts are configured also by POP?

    All other emails are successfully returned.


     
  •  01-18-2010, 11:06 PM 217664 in reply to 216397

    Re: Error listing Exchange reply messages .NET

    Hi,

    Could you please try the following:

    1. Change the webdav query to:
    string folderenc = HttpUtility.HtmlEncode(mailboxUri);
    const string
                shallowFormatString = "SELECT \"DAV:contentclass\""
                 + ",\"urn:schemas:mailheader:subject\""
                 + ",\"urn:schemas:mailheader:from\""
                 + ",\"urn:schemas:mailheader:to\""
                 + ",\"urn:schemas:mailheader:cc\""
                 + ",\"urn:schemas:mailheader:message-id\""
                 + " FROM SCOPE"
                 + "('shallow traversal of \"{0}\"')";
                string query = string.Format(shallowFormatString, folderenc);

    2. Please include folder name as well in mailboxuri variable e.g. it should be like
    string mailboxUri = "https://ex07sp1/exchange/Administrator/Inbox";

    This should get normal messages and read/delivery receipts from the inbox folder of the user.

    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
  •  01-27-2010, 12:16 AM 219259 in reply to 217664

    Re: Error listing Exchange reply messages

    This was exactly what I needed, and actually what I expected from the default ListMessages(string folder) method.  The various ExchangeClient ListMessages methods have no documentation, and required reflection to even figure out what the parameters were.  Here is the only documentation on your site and in the compiled help file for these methods:

    ============================

    Lists the mail message in the specified folder.

    Overload List
    Lists the mail message in the specified folder.
    public override ExchangeMessageInfoCollection ListMessages(string);

    List the messages in the specified folder
    public ExchangeMessageInfoCollection ListMessages(string,bool);

    Lists the messages.
    public ExchangeMessageInfoCollection ListMessages(string,string);

    List the messages in the specified folder
    public ExchangeMessageInfoCollection ListMessages(string,string,bool);

    ============================

    If you click any of the links to see the details you get a blank page.

    I could see this kind of documentation for an open source project where you could at least look at the source code, to try and figure out what the methods do, but for a product that is purchased, where we don't have access to the source code, and the code has been obfuscated, it is very difficult to figure out how to properly use the API's, especially if they are not intuitive.  A method like ListMessages with only a folder as an argument, should by default list ALL messages, not filter it to only a specific type of messages like it does now where all the undeliverables are excluded.  I wasted a day or two looking into other API's I could use because until I found this post, I couldn't figure out how to get to all the messages, since the primary purpose of the application I am writing is to process a mailbox where all the undeliverable messages get delivered.

    It would really be helpful if Aspose could either provide source code, or at least unobfuscated libraries to paying customers so that we could figure out how to use the various API's that are lacking any meaningful documentation.  The examples are helpful when you can find one that does exactly what you want, but otherwise trying to figure out what the parameters are, and what they do takes way more time than it should, and in some cases is almost impossible.

    I do appreciate the post that solved my problem, it's great that there is forum support, and I think there is a lot of potential in the library, but in the long term, if people can't figure out how to use the Aspose libraries without posting every question or trying to decipher obfuscated reflected code, they will go somewhere else.


    Rick
     
  •  01-27-2010, 3:45 AM 219300 in reply to 219259

    Re: Error listing Exchange reply messages .NET

    Hi Rick,

    Your concerns are very valid. We have plans to add descriptions and code samples to the API documentations in near future.

    We are also considering to enhance ListMessages() method to get messages based on parameters instead of filtering messages by default. It is also added in our issue tracking system (ID: 13602). We will notify you when we make some progress.

    I am very sorry for the inconvenience caused. In case you have any valuable suggestions, please feel free to create new thread in the forums. We will try our best to make the library more useful.

    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
  •  01-27-2010, 7:51 AM 219344 in reply to 219300

    Re: Error listing Exchange reply messages

    Thanks, I appreciate the response, and I realize that writing good documentation takes time, and it never seems there is enough of that.  As I said in my previous post, I think the libarary has a lot of desirable features.  It does however become frustrating when something is not working as expected, and if the documentation is not complete and we have no access to the source code, it makes it difficult to be aware of and take full advantage of  all the functionality that is available.  It also makes it difficult to know if something is working as it is supposed to, or if there is a bug that needs to be reported.

    I do think that using a parameterized approach to the ListMessages methods would be ideal.  Possibly passing in a set of enum flags for the various types of messages that could be or'd together, or some other method that would let you select multiple message types at once if desired, with a simple option to get all messages.  The most common scenarios, should be the most straight forward.

    Anyway, now that I can get all the messages, I'll be able to move forward with the project.  It is good to know that if I do run into issues I can at least post to this forum and get a response.

    Rick


    Rick
     
  •  03-15-2010, 5:35 AM 227173 in reply to 217664

    Re: Error listing Exchange reply messages

    Hi, sorry for the late reply.

    The following code works great


    saqib.razzaq:
    Hi,

    Could you please try the following:

    1. Change the webdav query to:
    string folderenc = HttpUtility.HtmlEncode(mailboxUri);
    const string
                shallowFormatString = "SELECT \"DAV:contentclass\""
                 + ",\"urn:schemas:mailheader:subject\""
                 + ",\"urn:schemas:mailheader:from\""
                 + ",\"urn:schemas:mailheader:to\""
                 + ",\"urn:schemas:mailheader:cc\""
                 + ",\"urn:schemas:mailheader:message-id\""
                 + " FROM SCOPE"
                 + "('shallow traversal of \"{0}\"')";
                string query = string.Format(shallowFormatString, folderenc);

    2. Please include folder name as well in mailboxuri variable e.g. it should be like
    string mailboxUri = "https://ex07sp1/exchange/Administrator/Inbox";

    This should get normal messages and read/delivery receipts from the inbox folder of the user.


     it's a little bit strange why the method

    "public ExchangeMessageInfoCollection ListMessages(string folder, bool recursive);"

    doesn't lists all the messages.


    Thanks for the help.
     
  •  11-08-2010, 3:33 PM 267981 in reply to 227173

    Re: Error listing Exchange reply messages

    I found this post trying to figure out why ExchangeClient.ListMessages was not retrieving the same list of messages I see in Outlook.  Before trying the query above I only receive 796 messages with every call and some of the 796 messages appear to be garbage. 

    I tried the query provided above,  I'm getting all of my message from my inbox, plus the garbage messages.  However I am no longer getting Cc or To information for any of the messages.  Also most of the garbage messages don't have a From, To, CC or subject.

    Any idea how to filter out the unwanted message?

     

     
  •  11-12-2010, 5:11 AM 268648 in reply to 267981

    Re: Error listing Exchange reply messages .NET

    Hi,

    We will look into this issue and will get back to you when it gets fixed.

    Could you please try using ExchangeWebServiceClient class, if you are using MS Exchange Server 2007 or later? Sample for downloading messages: http://www.aspose.com/documentation/.net-components/aspose.network-for-.net/fetching-messages-from-exchange-server-mailbox.html.

    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
  •  03-02-2011, 6:29 PM 288741 in reply to 216051

    Re: Error listing Exchange reply messages

    The issues you have found earlier (filed as 13602) have been fixed in this update.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.
     
View as RSS news feed in XML