(AutoIt) Extract Files from MIME
Extract files from a MIME message. Note: This example requires Chilkat v11.0.0 or greater.
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
|