(AutoIt) Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail. Note: This example requires Chilkat v11.0.0 or greater.
$oImap = ObjCreate("Chilkat.Imap")
; ...
; ...
; ------------------------------------------------------------------------
; The FetchSingle method is deprecated:
Local $oEmailObj = $oImap.FetchSingle(1,False)
If ($oImap.LastMethodSuccess = False) Then
ConsoleWrite($oImap.LastErrorText & @CRLF)
Exit
EndIf
; ...
; ...
; ------------------------------------------------------------------------
; Do the equivalent using FetchEmail.
; Your application creates a new, empty Email object which is passed
; in the last argument and filled upon success.
Local $bHeaderOnly = False
$oEmail = ObjCreate("Chilkat.Email")
Local $bSuccess = $oImap.FetchEmail($bHeaderOnly,1,False,$oEmail)
If ($bSuccess = False) Then
ConsoleWrite($oImap.LastErrorText & @CRLF)
Exit
EndIf
|