Sample code for 30+ languages & platforms
VB.NET 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 VB.NET Downloads

VB.NET
Dim success As Boolean = False

'  Assumes Chilkat is unlocked. See Global Unlock Sample.

Dim email As New Chilkat.Email
success = email.LoadEml("message.eml")
If (success <> True) Then
    Debug.WriteLine(email.LastErrorText)
    Exit Sub
End If

Dim mimeBytes As New Chilkat.BinData
success = email.GetMimeBd(mimeBytes)
If (success <> True) Then
    Debug.WriteLine(email.LastErrorText)
    Exit Sub
End If

Dim mime As New Chilkat.Mime
success = mime.LoadMimeBd(mimeBytes)
If (success <> True) Then
    Debug.WriteLine(mime.LastErrorText)
    Exit Sub
End If

Debug.WriteLine(mime.GetStructure("text"))