Message To value is incorrect

Hi All,

I’m using the Aspose Email ddl to grab some emails from accounts in a local mail exchange.

ExchangeMessageInfo msgInfo

var msgUri = msgInfo.UniqueUri;
var msg = client.FetchMessage(msgUri);

I’ve been testing with emails and found something very odd.

When I try to retrieve an email that contains more than one 'To" email address the value of
shows the first address correctly, but then shows only the name of the
second email address and if there are any more email address they do not

E.G. I send an email to:
“123”; “abc”; “def”;

The To value ends up being: (semi-colon shown to distinguish a different mail address)
“123”; “abc”

When I manually view the email, it contains all of the To: email addresses.
Is there some sort of setting that I am missing? Or is this a bug?

Grateful for any help,

Hi Andrew,

Thank you for using Aspose.Email.

After an initial investigation, I was able to reproduce this issue at my end using the latest version of Aspose.Email for .NET 2.8.0. I have logged it in our issue tracking system as NETWORKNET-33741 for further investigation by the development team and will update you here as soon as there is some information or fix available in this regard.

Code Used:

private static void TestMulitpleTos()
    MailMessage msg = new MailMessage();
    msg.From = "";
    msg.To.Add(new MailAddress("", "Kashif Iqbal Aspose"));
    msg.To.Add(new MailAddress("", "Kashif Iqbal Yahoo"));
    msg.To.Add(new MailAddress("", "Kashif Iqbal Hotmail"));

    //Adding this way also not working
    //msg.To.Add("Kashif Iqbal Aspose ");
    //msg.To.Add("Kashif Iqbal yahoo ");
    //msg.To.Add("Kashif Iqbal hotmail ");

    string strSubject = "Test Issue " + Guid.NewGuid().ToString();
    msg.Subject = strSubject;

    msg.Body = "This is test Email for multiple To's";

    SmtpClient client = GetSmtpClient();

    Console.WriteLine("Message Sent...");

    ExchangeWebServiceClient ewsClient = GetAsposeEWSClient();
    ExchangeMessageInfoCollection msgCollection = ewsClient.ListMessages(ewsClient.MailboxInfo.InboxUri, 5);

    foreach (ExchangeMessageInfo msgInfo in msgCollection)
        if (strSubject == msgInfo.Subject)
            MailMessage msg2 = ewsClient.FetchMessage(msgInfo.UniqueUri);
            Console.WriteLine("Total Recepients: " + msg2.To.Count);
            foreach (MailAddress address in msg2.To)
                Console.WriteLine("To Name: " + address.DisplayName);
                Console.WriteLine("To Address: " + address.Address);

Hi there,

When is the next planned release for Aspose.Email (with this bug fixed if possible)?
I assumed that it was about every month judging on the release dates of prior Aspose.Email

Andrew Chin.

Hi Andrew,

After checking the status of this issue from our issue tracking system, I would like to share with you that this issue is still pending for analysis by our development team and has been scheduled to be fixed in Aspose.Email for .NET 3.0 version. You’ll get automatic notification about the resolution of this issue once the fix is available and we appreciate your patience till then.

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

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.