(AutoIt) POP3 Fetch a Single Email by UIDL
Demonstrates how to fetch a single email by UIDL.
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oMailman = ObjCreate("Chilkat.MailMan")
$oMailman.MailHost = "pop.example.com"
$oMailman.PopUsername = "myLogin"
$oMailman.PopPassword = "myPassword"
$oMailman.MailPort = 995
$oMailman.PopSsl = True
Local $oSa = $oMailman.GetUidls()
If ($oMailman.LastMethodSuccess = False) Then
ConsoleWrite($oMailman.LastErrorText & @CRLF)
Exit
EndIf
; Download each email by UIDL.
Local $sUidl
Local $i = 0
Local $iNumUidls = $oSa.Count
While $i < $iNumUidls
$sUidl = $oSa.GetString($i)
ConsoleWrite($sUidl & @CRLF)
Local $oEmail = $oMailman.FetchEmail($sUidl)
If ($oMailman.LastMethodSuccess = False) Then
ConsoleWrite($oMailman.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite($oEmail.Subject & @CRLF)
ConsoleWrite("" & @CRLF)
$i = $i + 1
Wend
|