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

Extract Files from MIME

See more MIME Examples

Extract files from a MIME message.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = 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
    System.DebugLog(mime.LastErrorText)
    Return
End If

Dim st As New Chilkat.StringTable
success = mime.PartsToFiles("/temp/mimeParts",st)
If (success = False) Then
    System.DebugLog(mime.LastErrorText)
    Return
End If

Dim n As Int32
n = st.Count

//  Display the paths of the files created:
Dim i As Int32
i = 0
While i < n
    System.DebugLog(st.StringAt(i))
    i = i + 1
Wend