Sample code for 30+ languages & platforms
B4X Requires Chilkat v11.0.0+

Pass an Email object to the MIME API

See more Email Object Examples

Serialize an Email into a fresh BinData buffer and load those bytes into Mime to inspect the tree. Keep the original file separately when byte-for-byte preservation matters, such as for DKIM verification.

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

'  Assumes Chilkat is unlocked. See Global Unlock Sample.

Dim email As ChilkatEmail
email.Initialize
success = email.LoadEml("message.eml")
If success <> True Then
    Log(email.LastErrorText)
    Return
End If

Dim mimeBytes As ChilkatBinData
mimeBytes.Initialize
success = email.GetMimeBd(mimeBytes)
If success <> True Then
    Log(email.LastErrorText)
    Return
End If

Dim mime As ChilkatMime
mime.Initialize
success = mime.LoadMimeBd(mimeBytes)
If success <> True Then
    Log(mime.LastErrorText)
    Return
End If

Log(mime.GetStructure("text"))