ASP Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

ASP Examples

ASP String
ASP Byte Array
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
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar
ASP Upload
XML
XMP
Zip Compression

More Examples...
Email Object
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
Bzip2
LZW
Icon

 

 

 

 

 

 

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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
'  The mailman object is used for receiving (POP3)
'  and sending (SMTP) email.
set mailman = Server.CreateObject("Chilkat.MailMan2")

'  Any string argument automatically begins the 30-day trial.
success = mailman.UnlockComponent("30-day trial")
If (success <> 1) Then
    Response.Write "Component unlock failed" & "<br>"

End If

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

'  Set the POP3 login/password.
mailman.PopUsername = "myLogin"
mailman.PopPassword = "myPassword"

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

Set sa = mailman.GetUidls()

numEmails = sa.Count

'  Download the emails in chunks of 10 emails each.
chunkBeginIdx = 0
chunkEndIdx = 9
If (chunkEndIdx >= numEmails) Then
    chunkEndIdx = numEmails - 1
End If

set saChunk = Server.CreateObject("Chilkat.CkStringArray")
Do While (chunkEndIdx < (numEmails - 1))

    '  Build a chunk of 10 UIDLs.
    saChunk.Clear 
    For i = chunkBeginIdx To chunkEndIdx
        saChunk.Append sa.GetString(i)
    Next

    '  Display the UIDLs in this chunk...

    chunkStr = saChunk.SaveToText()
    Response.Write Server.HTMLEncode( chunkStr) & "<br>"
    Response.Write Server.HTMLEncode( "----" _
         & "<br>") & "<br>"

    '  Download this chunk of email from the POP3 server.

    Set bundle = mailman.FetchMultiple(saChunk)
    If (bundle Is Nothing ) Then
        Response.Write mailman.LastErrorText & "<br>"

    End If

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

    '  Get the next chunk...
    chunkBeginIdx = chunkBeginIdx + 10
    If (chunkBeginIdx >= numEmails) Then
        Exit Do
    End If

    chunkEndIdx = chunkEndIdx + 10
    If (chunkEndIdx >= numEmails) Then
        chunkEndIdx = numEmails - 1
    End If

Loop


%>
</body>
</html>

 

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

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