0
votes

I'm using the MailSystem.NET IMAP functionality to retrieve E-mail.

Connecting and login succeed and I see there are 4 messages on the server. When I retrieve the messages I can read the subject, from/to etc. However, when I read the Email body only a fraction of the body is displayed.

Message msg = inbox.Fetch.MessageObject(i);
Console.WriteLine(msg.BodyHtml.Text);

The code above will display:

<!DOCTYPE

How can I get the complete content of the E-mail body? (Also asked on CodePlex, but there is not a lot of activity there).

Regards,

Michel

3
What does the fraction look like? What do you get if you use something like BodyPlainText (if there is any)? - František Žiačik
msg.BodyText.Text is an empty string. I will add the fraction to my question. - Michel van Engelen
Can you examine (and post) real raw contents of the message in a mail client? Looks to me like a bug in the library. - František Žiačik

3 Answers

0
votes

Issues with IMAP might help with your quest.

0
votes

I use a different library now, but when I checked codeplex an answer was provided:

This seems to be the result of last change http://mailsystem.codeplex.com/SourceControl/changeset/changes/59386. I do not know what is the reason of this change, but it seems to be absolute non logical. If you remove it from your source code, the system would work fine.

0
votes

Try this code:

Message mailMsg = mailbox.Fetch.MessageObject(i);
string mailBodyContent = system.Text.Encoding.UTF8.GetString(mailMsg.OriginalData);
Console.WriteLine(mailBodyContent);

This will return the entire mail body.