Sample code for 30+ languages & platforms
AutoIt

Extract Files from MIME

See more MIME Examples

Extract files from a MIME message.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

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

$oMime = ObjCreate("Chilkat.Mime")

; Load a MIME document from a file:
; (.mht and .eml files contain MIME).
$bSuccess = $oMime.LoadMimeFile("mst.mht")
If ($bSuccess = False) Then
    ConsoleWrite($oMime.LastErrorText & @CRLF)
    Exit
EndIf

$oSt = ObjCreate("Chilkat.StringTable")
$bSuccess = $oMime.PartsToFiles("/temp/mimeParts",$oSt)
If ($bSuccess = False) Then
    ConsoleWrite($oMime.LastErrorText & @CRLF)
    Exit
EndIf

Local $iN = $oSt.Count

; Display the paths of the files created:
Local $i = 0
While $i < $iN
    ConsoleWrite($oSt.StringAt($i) & @CRLF)
    $i = $i + 1
Wend