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
(Visual FoxPro) Find the "Sent" IMAP MailboxFind the "Sent" IMAP mailbox. Also finds the Junk and Trash mailboxes..
LOCAL loImap LOCAL lnSuccess LOCAL lcRefName LOCAL lcWildcardedMailbox LOCAL loMboxes LOCAL i * This example assumes the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Imap') loImap = CreateObject('Chilkat.Imap') loImap.Ssl = 1 loImap.Port = 993 lnSuccess = loImap.Connect("imap.yourmailserver.com") IF (lnSuccess <> 1) THEN ? loImap.LastErrorText RELEASE loImap CANCEL ENDIF * Login or authenticate in some way.. lnSuccess = loImap.Login("your_login","your_password") IF (lnSuccess <> 1) THEN ? loImap.LastErrorText RELEASE loImap CANCEL ENDIF * Get the list of mailboxes. lcRefName = "" lcWildcardedMailbox = "*" loMboxes = loImap.ListMailboxes(lcRefName,lcWildcardedMailbox) IF (loImap.LastMethodSuccess = 0) THEN ? loImap.LastErrorText RELEASE loImap CANCEL ENDIF * The mailbox with the "/Sent" flag is the "Sent" mailbox. * Likewise for Junk and Trash.. i = 0 DO WHILE i < loMboxes.Count IF (loMboxes.HasFlag(i,"\Sent") = 1) THEN ? "Sent mailbox: " + loMboxes.GetName(i) ENDIF IF (loMboxes.HasFlag(i,"\Junk") = 1) THEN ? "Junk mailbox: " + loMboxes.GetName(i) ENDIF IF (loMboxes.HasFlag(i,"\Trash") = 1) THEN ? "Trash mailbox: " + loMboxes.GetName(i) ENDIF i = i + 1 ENDDO * Disconnect from the IMAP server. lnSuccess = loImap.Disconnect() RELEASE loMboxes RELEASE loImap |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.