![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Visual FoxPro) Download MIME Source of Emails in IMAP MailboxDemonstrates how to download the MIME source for emails on an IMAP server. Note: This example requires Chilkat v11.0.0 or greater.
LOCAL lnSuccess LOCAL loImap LOCAL lnNumMessages LOCAL loSbMime LOCAL lnSeqNum lnSuccess = 0 * This example assumes the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. loImap = CreateObject('Chilkat.Imap') * Connect to an IMAP server. * Use TLS loImap.Ssl = 1 loImap.Port = 993 lnSuccess = loImap.Connect("imap.example.com") IF (lnSuccess = 0) THEN ? loImap.LastErrorText RELEASE loImap CANCEL ENDIF * Login lnSuccess = loImap.Login("myLogin","myPassword") IF (lnSuccess = 0) THEN ? loImap.LastErrorText RELEASE loImap CANCEL ENDIF * Select an IMAP mailbox lnSuccess = loImap.SelectMailbox("Inbox") IF (lnSuccess = 0) THEN ? loImap.LastErrorText RELEASE loImap CANCEL ENDIF * The NumMessages property contains the number of messages in the selected mailbox. lnNumMessages = loImap.NumMessages IF (lnNumMessages = 0) THEN ? "No messages exist in the Inbox." RELEASE loImap CANCEL ENDIF loSbMime = CreateObject('Chilkat.StringBuilder') FOR lnSeqNum = 1 TO lnNumMessages loSbMime.Clear() lnSuccess = loImap.FetchSingleAsMimeSb(lnSeqNum,0,loSbMime) IF (lnSuccess = 0) THEN ? loImap.LastErrorText RELEASE loImap RELEASE loSbMime CANCEL ENDIF * The MIME source of the downloaded email is contained in sbMime. NEXT * Disconnect from the IMAP server. lnSuccess = loImap.Disconnect() RELEASE loImap RELEASE loSbMime |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.