![]() |
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
(Unicode C++) Process Large POP3 MailboxDemonstrates how to read email from a mailbox that may contain a large number of emails. Note: This example requires Chilkat v11.0.0 or greater.
#include <CkMailManW.h> #include <CkStringTableW.h> #include <CkEmailW.h> void ChilkatSample(void) { bool success = false; // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. CkMailManW mailman; mailman.put_MailHost(L"pop.example.com"); mailman.put_PopUsername(L"myLogin"); mailman.put_PopPassword(L"myPassword"); mailman.put_MailPort(995); mailman.put_PopSsl(true); // Get the list of UIDLs for all emails in the mailbox. CkStringTableW stUidls; success = mailman.FetchUidls(stUidls); if (success == false) { wprintf(L"%s\n",mailman.lastErrorText()); return; } // Download each email by UIDL. CkEmailW email; int count = stUidls.get_Count(); int i = 0; while (i < count) { // Download the full email. const wchar_t *uidl = stUidls.stringAt(i); success = mailman.FetchByUidl(uidl,false,0,email); if (success == false) { wprintf(L"%s\n",mailman.lastErrorText()); return; } wprintf(L"%d\n",i); wprintf(L"UIDL: %s\n",uidl); wprintf(L"From: %s\n",email.ck_from()); wprintf(L"Subject: %s\n",email.subject()); i = i + 1; } mailman.Pop3EndSession(); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.