We are using IMAP part of Mail.dll version 3.0.13092.1409
If I receive email message with the following characteristics:
mimeStructure is a result of the call to client.GetMessageInfoByUID(messageUid)
mimeStructure.BodyStructure.Text.Size = 0
mimeStructure.BodyStructure.Text.ContentTransferEncoding = 7bit
And call client.GetMimePartByUID(messageUid, mimeStructure)
it throws ArgumentNullException.
If ContentTransferEncoding is "quoted-printable" the problem doesn't exists.
Currently we made temporary workaround with the following sample code:
var msgInfo = client.GetMessageInfoByUID(messageUid);
var mimeStructure = msgInfo.BodyStructure.Text ?? msgInfo.BodyStructure.Html;
if (mimeStructure != null) {
try {
var bodyBytes = client.GetMimePartByUID(messageUid, mimeStructure);
var bodyText = mimeStructure.Encoding.GetString(bodyBytes);
imm.BodyPlainText = bodyText;
} catch (Exception ex) {
// Code to handle (possibly Size=0 + ContentTransferEncoding=7bit) exception...
}
}
Is this problem fixed in newer versions of Mail.dll ?