| Function C_EML_Back_GetMime (doc As NotesDocument, stream As NotesStream) As Integer |
| On Error GoTo errhandler |
| |
| Dim mime As NotesMIMEEntity |
| Dim child As NotesMIMEEntity |
| |
| Set mime = doc.GetMIMEEntity |
| |
| '** 8.5.1 introduced the convertToMIME() function |
| '** REMOVE this if/then block if you're on less than 8.5.1 |
| If (mime Is Nothing) Then |
| Call doc.ConvertToMIME(2) |
| Set mime = doc.GetMIMEEntity |
| End If |
| |
| If Not (mime Is Nothing) Then |
| Call C_EML_Back_PrintMime(mime, stream) |
| C_EML_Back_GetMime = True |
| Else |
| Call stream.WriteText( "No MIME Found in " & doc.Subject(0), EOL_PLATFORM ) |
| End If |
| |
| Exit Function |
| |
| errhandler: |
| IB_MSGBox "Error in -C_EML_Back_GetMime- Error: " & Error & " (" & Err & ") in line: " & Erl , 16, "Error" |
| Exit Function |
| End Function |
| |
| |
| |
| |
| |
| Function C_EML_Back_PrintMime (mime As NotesMIMEEntity, stream As NotesStream) As Integer |
| |
| On Error GoTo errhandler |
| Dim child As NotesMIMEEntity |
| Dim zwerg As String |
| |
| If (mime Is Nothing) Then |
| Exit Function |
| End If |
| |
| If (mime.Encoding = ENC_IDENTITY_BINARY) Then |
| Call mime.DecodeContent |
| Call mime.EncodeContent(ENC_BASE64) |
| End If |
| |
| Call mime.GetEntityAsText(stream) <----- Hier werden die EML-Header Daten auf die Platte geschrieben! |
| |
| %REM |
| zwerg = mime.Headers |
| If InStr(zwerg, "(BodyFieldDummy)") > 0 Then |
| zwerg = Replace(zwerg, "(BodyFieldDummy)", "Memo") |
| End If |
| Call stream.WriteText( zwerg, EOL_NONE ) |
| %END REM |
| |
| If mime.ContentType = "multipart" Then |
| If (mime.Preamble <> "") Then |
| Call stream.WriteText( mime.Preamble, EOL_NONE ) |
| End If |
| |
| Set child = mime.GetFirstChildEntity |
| While Not(child Is Nothing) |
| Call C_EML_Back_WriteAsciiBytes(stream, child.BoundaryStart) |
| Call C_EML_Back_PrintMime( child, stream ) |
| Call C_EML_Back_WriteAsciiBytes(stream, child.BoundaryEnd) |
| Set child = child.GetNextSibling |
| Wend |
| End If |
| |
| |
| C_EML_Back_PrintMime = True |
| |
| Exit Function |
| |
| errhandler: |
| MSGBox "Error in -C_EML_Back_PrintMime- Error: " & Error & " (" & Err & ") in line: " & Erl , 16, "Error" |
| Exit Function |
| End Function |
| |
| |