I'm trying to parse MIME emails from Lotus notes with .NET Domino interop. When the emails are not in MIME format I've succeed to get Body content through simple NotesDocument.GetFirstItem("Body").Text; clause. However with MIME I'm getting null or empty string when I'm trying to parse body content.
var session = new NotesSession();
session.Initialize("RadioLotus028");
session.ConvertMime = false;
var db = session.GetDatabase("PRGLNApps01/CZ/RFERL", "mail-in\\SEEurope\\MIA.nsf", false);
if (db == null) throw new ArgumentNullException("cannot load database");
var legnth = db.AllDocuments.Count;
for (int i = 1; i < legnth; i++)
{
NotesDocument doc = db.AllDocuments.GetNthDocument(i);
NotesMIMEEntity bodyMIME = doc.GetMIMEEntity();
NotesStream stream = session.CreateStream();
//bodyMIME.GetContentAsBytes(stream);
//bodyMIME.GetEntityAsText(stream);
bodyMIME.GetContentAsText(stream);
string bodyString = stream.ReadText();
var bodyString2 = stream.Read();
string bodyString3 = bodyMIME.ContentAsText;
var from = doc.GetFirstItem("From").Text;
var subject = doc.GetFirstItem("Subject").Text;
}
Does anyone have any experience with this problem? Or how to get body content as a HTML or RichfullText or any other way?