Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) Find the "Sent" IMAP MailboxFind the "Sent" IMAP mailbox. Also finds the Junk and Trash mailboxes..
; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oImap = ObjCreate("Chilkat.Imap") $oImap.Ssl = True $oImap.Port = 993 Local $bSuccess = $oImap.Connect("imap.yourmailserver.com") If ($bSuccess <> True) Then ConsoleWrite($oImap.LastErrorText & @CRLF) Exit EndIf ; Login or authenticate in some way.. $bSuccess = $oImap.Login("your_login","your_password") If ($bSuccess <> True) Then ConsoleWrite($oImap.LastErrorText & @CRLF) Exit EndIf ; Get the list of mailboxes. Local $sRefName = "" Local $sWildcardedMailbox = "*" Local $oMboxes = $oImap.ListMailboxes($sRefName,$sWildcardedMailbox) If ($oImap.LastMethodSuccess = False) Then ConsoleWrite($oImap.LastErrorText & @CRLF) Exit EndIf ; The mailbox with the "/Sent" flag is the "Sent" mailbox. ; Likewise for Junk and Trash.. Local $i = 0 While $i < $oMboxes.Count If ($oMboxes.HasFlag($i,"\Sent") = True) Then ConsoleWrite("Sent mailbox: " & $oMboxes.GetName($i) & @CRLF) EndIf If ($oMboxes.HasFlag($i,"\Junk") = True) Then ConsoleWrite("Junk mailbox: " & $oMboxes.GetName($i) & @CRLF) EndIf If ($oMboxes.HasFlag($i,"\Trash") = True) Then ConsoleWrite("Trash mailbox: " & $oMboxes.GetName($i) & @CRLF) EndIf $i = $i + 1 Wend ; Disconnect from the IMAP server. $bSuccess = $oImap.Disconnect() |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.