(AutoIt) Transition from Imap.FetchSequenceAsMime to Imap.FetchSingleBd
Provides instructions for replacing deprecated FetchSequenceAsMime method calls with FetchSingleBd. Note: This example requires Chilkat v11.0.0 or greater.
$oImap = ObjCreate("Chilkat.Imap")
; ...
; ...
Local $iStartSeqNum = 1
Local $iCount = 5
; ------------------------------------------------------------------------
; The FetchSequenceAsMime method is deprecated:
Local $oSa = $oImap.FetchSequenceAsMime($iStartSeqNum,$iCount)
If ($oImap.LastMethodSuccess = False) Then
ConsoleWrite($oImap.LastErrorText & @CRLF)
Exit
EndIf
; ...
; ...
; ------------------------------------------------------------------------
; Do the equivalent using FetchSingleBd.
$oImap.AutoDownloadAttachments = True
Local $bSuccess = False
$oBdMime = ObjCreate("Chilkat.BinData")
Local $bUid = False
Local $i = 0
While $i < $iCount
$bSuccess = $oImap.FetchSingleBd($iStartSeqNum + $i,$bUid,$oBdMime)
; ...
; ...
$i = $i + 1
Wend
|