FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
Socket
Spider
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Email Object
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

Process Large POP3 Mailbox

Demonstrates how to read email from a mailbox that may contain a large number of emails (on the order of thousands of emails or more).

Download Chilkat Email ActiveX for POP3 / SMTP

LOCAL loMailman
LOCAL lnSuccess
LOCAL loSa
LOCAL i
LOCAL lnNumEmails
LOCAL lnChunkBeginIdx
LOCAL lnChunkEndIdx
LOCAL loSaChunk
LOCAL lcChunkStr
LOCAL loBundle

*  The mailman object is used for receiving (POP3)
*  and sending (SMTP) email.
loMailman = CreateObject('Chilkat.MailMan2')

*  Any string argument automatically begins the 30-day trial.

lnSuccess = loMailman.UnlockComponent("30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX("Component unlock failed")
    QUIT
ENDIF

*  Set the POP3 server's hostname
loMailman.MailHost = "mail.chilkatsoft.com"

*  Set the POP3 login/password.
loMailman.PopUsername = "myLogin"
loMailman.PopPassword = "myPassword"

*  First, get the list of UIDLs for all emails in the mailbox.

loSa = loMailman.GetUidls()

lnNumEmails = loSa.Count

*  Download the emails in chunks of 10 emails each.

lnChunkBeginIdx = 0

lnChunkEndIdx = 9
IF (lnChunkEndIdx >= lnNumEmails) THEN
    lnChunkEndIdx = lnNumEmails - 1
ENDIF

loSaChunk = CreateObject('Chilkat.CkStringArray')
DO WHILE (lnChunkEndIdx < (lnNumEmails - 1))

    *  Build a chunk of 10 UIDLs.
    loSaChunk.Clear()
    FOR i = lnChunkBeginIdx TO lnChunkEndIdx
        loSaChunk.Append(loSa.GetString(i))
    NEXT

    *  Display the UIDLs in this chunk...

    lcChunkStr = loSaChunk.SaveToText()
    ? lcChunkStr
    ? "----" + CHR(13)+CHR(10)

    *  Download this chunk of email from the POP3 server.

    loBundle = loMailman.FetchMultiple(loSaChunk)
    IF (loBundle = NULL ) THEN
        =MESSAGEBOX(loMailman.LastErrorText)
        QUIT
    ENDIF

    *  Process the bundle...
    *  (your application's processing code goes here...)

    RELEASE loBundle

    *  Get the next chunk...
    lnChunkBeginIdx = lnChunkBeginIdx + 10
    IF (lnChunkBeginIdx >= lnNumEmails) THEN
        EXIT
    ENDIF

    lnChunkEndIdx = lnChunkEndIdx + 10
    IF (lnChunkEndIdx >= lnNumEmails) THEN
        lnChunkEndIdx = lnNumEmails - 1
    ENDIF

ENDDO

RELEASE loSa

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2009 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · ASP Mail Component · XML Parser