| Sub Initialize |
| 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 |
| Set db = s.CurrentDatabase |
| s.ConvertMIME = False |
| Set dc = db.UnprocessedDocuments |
| Set doc = dc.GetFirstDocument |
| Dim countChild As Integer |
| While Not(doc Is Nothing) |
| Msgbox "startMail mail->" & doc.subject(0) |
| Set mime = doc.GetMIMEEntity |
| If Not(mime Is Nothing) Then |
| If mime.ContentType = "multipart" Then |
| If mime.Preamble = "" Then |
| p$ = "No preamble" |
| Else |
| p$ = mime.Preamble |
| End If |
| Messagebox p$,, "preamble of:" & doc.GetItemValue("Subject")(0) |
| Set child = mime.GetFirstChildEntity |
| countChild = 0 |
| While Not(child Is Nothing) |
| countChild = countChild + 1 |
| |
| m = "Content type:" & Chr(9) & _ |
| child.ContentType & Chr(13) & _ |
| "Content subtype:" & Chr(9) & _ |
| child.ContentSubType & Chr(13) & _ |
| "Character set:" & Chr(9) & _ |
| child.Charset & Chr(13) & _ |
| "Encoding:" & Chr(9) & Chr(9) & _ |
| child.Encoding |
| Messagebox m,, "child: (" & Cstr(countChild) & " in Mail->" & doc.subject(0) |
| Messagebox child.Headers,, "Headers von child: (" & Cstr(countChild) & " in Mail->" & doc.subject(0) |
| |
| Messagebox child.ContentAsText,, "child: (" & Cstr(countChild) & " in Mail->" & doc.subject(0) |
| |
| Set child = child.GetNextSibling |
| Wend |
| Else ' if not multipart |
| |
| |
| m = "Content type:" & Chr(9) & _ |
| mime.ContentType & Chr(13) & _ |
| "Content subtype:" & Chr(9) & _ |
| mime.ContentSubType & Chr(13) & _ |
| "Character set:" & Chr(9) & _ |
| mime.Charset & Chr(13) & _ |
| "Encoding:" & Chr(9) & Chr(9) & _ |
| mime.Encoding |
| Messagebox m,, "main of mail:" & doc.GetItemValue("Subject")(0) |
| Messagebox mime.Headers,, "Headers of main of mail:" & doc.GetItemValue("Subject")(0) |
| |
| Messagebox mime.ContentAsText,, _ |
| "main of mail:" & doc.GetItemValue("Subject")(0) |
| End If |
| Else ' if not MIME |
| Messagebox "Not MIME",, _ |
| doc.GetItemValue("Subject")(0) |
| End If |
| Msgbox "END mail->" & doc.subject(0) |
| Set doc = dc.GetNextDocument(doc) |
| Wend |
| s.ConvertMIME = True ' Restore conversion |
| End Sub |
| |