Hi, I’m trying to get pristine unconverted MIME from my Notes inbox here, but so far I can’t get GetMIMEEntity to return anything other than null.
This is happening on a C#/.Net 2 (DOH! - not like we get any choice here) client accessing 7.0.1 Notes client through COM.
This is the actual code:
Domino.NotesSession session = new Domino.NotesSession();
session.Initialize(inboxSettings.Password);
session.ConvertMime = false;
string tempstr = session.GetEnvironmentString(“Location”, true);
Domino.NotesDatabase db = session.GetDatabase(inboxSettings.IncomingServer, “names”, false);
Domino.NotesView view = db.GetView(“Locations”);
Domino.NotesDocumentCollection col = view.GetAllDocumentsByKey(tempstr.Split(‘,’)[0], true);
Domino.NotesDocument doc = col.GetFirstDocument();
string ms = (doc.GetItemValue(“MailServer”) as object)[0] as string;
string mf = (doc.GetItemValue(“MailFile”) as object)[0] as string;
string mt = (doc.GetItemValue(“MailType”) as object)[0] as string;
db = session.GetDatabase(mt == “0” ? ms : “”, mf, false);
lotusNotesView = db.GetView(“($Inbox)”);
lotusNotesView.AutoUpdate = false;
doc = lotusNotesView.GetFirstDocument();
while (doc != null)
{
Domino.NotesMIMEEntity entity = doc.GetMIMEEntity(“Body”);
string subject = (doc.GetItemValue(“Subject”) as object)[0] as string;
foreach (object obj in doc.Items as object)
{
Domino.IItem2 item = obj as Domino.IItem2;
string name = item.Name;
int length = item.ValueLength;
entity = item.GetMIMEEntity();
if (entity != null)
Logger.Debug("Found entity.");
}
doc = lotusNotesView.GetNextDocument(doc);
}
I’m out of ideas here.