B4X Requires Chilkat v11.0.0+
B4X
Parsing a Multipart/Digest Email
See more Email Object Examples
This example demonstrates how to parse a multipart/digest email. An email parsed by this sample could have a MIME structure as follows:
multipart/mixed
text/plain
text/plain
multipart/digest
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
message/rfc822
text/plain
Chilkat B4X Downloads
Dim success As Boolean = False
Dim emlPath As String = "qa_data/eml/multipart_digest.eml"
Dim email As ChilkatEmail
email.Initialize
' For this example, we'll load the email from a .eml.
' The email could alternatively be loaded as a result of downloading from an IMAP or POP3 server..
success = email.LoadEml(emlPath)
If success = False Then
Log(email.LastErrorText)
Return
End If
Dim numDigests As Int = email.NumDigests
Log("num digests = " & numDigests)
Dim eDigest As ChilkatEmail
eDigest.Initialize
Dim i As Int = 0
Do While i < numDigests
email.GetDigestEmail(i, eDigest)
Log(i & ":" & eDigest.FromAddress & ", " & eDigest.Subject)
Dim m As String = eDigest.GetHeaderField("Message")
If eDigest.LastMethodSuccess = True Then
Log(" Message = " & m)
End If
i = i + 1
Loop