Hi!I am parsing emails using the NotesMimeEntity class and came across a weird problem.
When I parse a MIME part that is encoded using base64, the Encoding property of the NotesMimeEntity object is always set to ENC_IDENTITY_BINARY instead of ENC_BASE_64.
An example MIME part that is recognized as BINARY looks like this :
--------------060007030600080307070604
Content-Type: image/gif;
name=“back.GIF”
Content-Transfer-Encoding: base64
[…]
Is there some limitation I am not aware of, or am I simply missing something ? Here is the full code I use (button in the Memo form, Logger is an home-made class that write a String to a default text file).
Thanks in advance !
Alexis
Sub Click(Source As Button)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim mime As NotesMIMEEntity
Dim child As NotesMIMEEntity
Dim m As String
Dim myLog As New Logger
Dim workspace As New NotesUiWorkspace
Dim uiDoc As NotesUidocument
Set uiDoc = workspace.currentdocument
Set doc = uiDoc.Document
s.ConvertMIME = False
Set mime = doc.GetMIMEEntity
Call visitMimeRecursive(mime)
s.ConvertMIME = True
’ Restore conversion
End Sub
Sub visitMimeRecursive(notesEnt As NotesMimeEntity)
Dim child As NotesMimeEntity
Dim myLog As New Logger
If notesEnt Is Nothing Then
Exit Sub
End If
If Not(notesEnt Is Nothing) Then
If notesEnt.ContentType = "multipart" Then
Call myLog.log("multipart, calling recursive on each child",0)
If notesEnt.Preamble = "" Then
p$ = "No preamble"
Else
p$ = notesEnt.Preamble
End If
Call myLog.log("Preamble : " & p$,0)
Set child = notesEnt.GetFirstChildEntity
While Not(child Is Nothing)
Call visitMimeRecursive(child)
Set child = child.GetNextSibling
Wend
Else
’ if not multipart
Dim session As NotesSession
Set session = New NotesSession
Call myLog.log("Not multipart. Content type : " & Cstr(notesEnt.ContentType),0)
Call myLog.log("Content subtype : " & Cstr(notesEnt.ContentSubtype),0)
Call myLog.log("Encoding : " & Cstr(notesEnt.Encoding),0)
Call myLog.log("Charset : " & Cstr(notesEnt.Charset),0)
End If
Else
'if not MIME
Call myLog.log("Not MIME" ,0)
End If
End Sub