+1 vote

Hi,
when i load an email this way, i can not use ".ReplyTo.Count"

byte[] memo = Encoding.UTF8.GetBytes(memoContents);
IMail importedEmail = new MailBuilder().CreateFromEml(memo);
MailBuilder _message = importedEmail.ToBuilder();
int liReplyCount = _message.ReplyTo.Count;

liReplyCount gives always zero!

When creating "memoContents" theere is a Reply address
and send the mail will use this reply address
the only think i want to do is check te contents of this property, maybe change it or write contents to a log file.

In the debugger i can see the Reply address exists.
-   Count = 1 System.Collections.Generic.IList<Limilabs.Mail.Headers.MailBox> {System.Collections.Generic.List<Limilabs.Mail.Headers.MailBox>}

related to an answer for: CreateFromEml(string) is obsolete
by (2.0k points)
edited by

1 Answer

0 votes

Is there a reason why you use ToBuilder() method?
I don't think you should be loading a message in this way.

To obtain addresses specified in 'Reply-to' header, you should be using IMail.ReplyTo property:

IMail importedEmail = ...
int count = importedEmail.ReplyTo.Count;

Apart from that, it seems ToBuilder method should copy IMail.ReplyTo property - it's going to be fixed in the next release.

by (297k points)
...