Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

C++ Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
FileAccess
Firebase
GMail REST API
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Sheets
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)

Java KeyStore (JKS)
Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
Upload
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(C++) Download POP3 Email to MIME Strings

Download the email from a POP3 mailbox directly into MIME strings, without parsing into email objects.

Chilkat C/C++ Library Downloads

MS Visual C/C++

Linux/CentOS C/C++

Alpine Linux C/C++

MAC OS X C/C++

armhf/aarch64 C/C++

C++ Builder

iOS C/C++

Android C/C++

Win Mobile 5.0/Pocket PC 2003

Solaris C/C++

FreeBSD C/C++

OpenBSD C/C++

MinGW C/C++

#include <CkMailMan.h>
#include <CkStringArray.h>
#include <CkEmail.h>

void ChilkatSample(void)
    {
    // This example requires the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    bool success;

    // The mailman object is used for receiving (POP3) 
    // and sending (SMTP) email.
    CkMailMan mailman;

    // Set the POP3 server's hostname
    mailman.put_MailHost("pop.someMailServer.com");

    // Set the POP3 login/password.
    mailman.put_PopUsername("myLogin");
    mailman.put_PopPassword("myPassword");

    // First, get the complete set of UIDLs for the email in the POP3 mailbox:
    CkStringArray *saUidls = mailman.GetUidls();
    if (mailman.get_LastMethodSuccess() != true) {
        std::cout << mailman.lastErrorText() << "\r\n";
        return;
    }

    // Download the email as MIME strings (no parsing of the MIME)
    CkStringArray *saMime = mailman.FetchMultipleMime(*saUidls);
    if (mailman.get_LastMethodSuccess() != true) {
        std::cout << mailman.lastErrorText() << "\r\n";
        delete saUidls;
        return;
    }

    delete saUidls;

    // MIME strings may be loaded into email objects:
    int i;
    CkEmail email;
    for (i = 0; i <= saMime->get_Count() - 1; i++) {
        success = email.SetFromMimeText(saMime->getString(i));
        std::cout << "From: " << email.ck_from() << "\r\n";
        std::cout << "Subject: " << email.subject() << "\r\n";
    }

    delete saMime;
    }

 

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