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

Extract Files from MIME

See more MIME Examples

Extract files from a MIME message.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

'  This example requires the Chilkat API to have been previously unlocked.
'  See Global Unlock Sample for sample code.

Dim mime As New Chilkat.Mime

'  Load a MIME document from a file:
'  (.mht and .eml files contain MIME).
success = mime.LoadMimeFile("mst.mht")
If (success = False) Then
    Debug.WriteLine(mime.LastErrorText)
    Exit Sub
End If


Dim st As New Chilkat.StringTable
success = mime.PartsToFiles("/temp/mimeParts",st)
If (success = False) Then
    Debug.WriteLine(mime.LastErrorText)
    Exit Sub
End If


Dim n As Integer = st.Count

'  Display the paths of the files created:
Dim i As Integer = 0
While i < n
    Debug.WriteLine(st.StringAt(i))
    i = i + 1
End While