Free Support Forum - aspose.com

ImapClient: PR_ORIGINAL_DISPLAY_TO_W not working

Hi,

Thank you for your earlier work aorund method for reading Undelivered emails. But it seems that the same problem reported earlier also exhibits in Imapclient. Can you please consider it for investigation please?

Hi Mark,


Thanks for writing to us.

After an inital investigation, I was able to reproduce this issue at my end using the latest version of Aspose.Email for .NET 2.6.0 and following code. I have reported this issue to our development team for further investigation by logging it as NETWORKNET-33636 in our issue tracking system. I have also linked this thread with the logged issue so that you can be notified automatically once the issue is fixed.

ImapClient client = new
ImapClient(serveraddress.com,
993, “username”, “password”, CheckCertificate);<o:p></o:p>

client.EnableSsl = true;

client.Connect(true);

client.Login();

client.SelectFolder("Inbox");

// Set conditions

ImapQueryBuilder builder = new ImapQueryBuilder();

// Subject contains "Newsletter"

builder.Subject.Contains("Undeliverable");

// Build the query

MailQuery query = builder.GetQuery();

// Get list of messages

ImapMessageInfoCollection messages = client.ListMessages(query);

Console.WriteLine("Imap: Undelivered messages Count:: " + messages.Count + " message(s) found.");

foreach (ImapMessageInfo msgInfo in messages)
{

MailMessage mailMsg = client.FetchMessage(msgInfo.UniqueId);

MapiMessage mapiMsg = MapiMessage.FromMailMessage(mailMsg);

if (mapiMsg.Properties.Contains(MapiPropertyTag.PR_ORIGINAL_DISPLAY_TO_W))

Console.WriteLine("PR_ORIGINAL_DISPLAY_TO_W property exists..");

else

Console.WriteLine("PR_ORIGINAL_DISPLAY_TO_W property doesn't exist..");

}

// Disconnect from IMAP

client.Disconnect();