Archived Forum Post

Index of archived forum posts


Code don't work (post client, POP3 protokol)

Aug 31 '16 at 13:04

Fryiends! I speak English very bad, so I am sorry

I vave mailbox: password Baq0L,/lRX

Now (24.08.2016) that mailbox contetts three (3) letters. I want to know this fact with code

code: (I take his here):

#include <CkMailMan.h>
#include <iostream>
#include <stdio.h>

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

    //  Any string argument automatically begins the 30-day trial.
    bool success = mailman.UnlockComponent("30-day trial");
    if (success != true) {
        std::cout << "Component unlock failed" << "\r\n";
        return 0;

    //  Set the POP3 server's hostname

    //  Set the POP3 login/password.

    //  Get the number of messages in the mailbox.
    int numMessages;

    numMessages = mailman.GetMailboxCount();
    std::cout << numMessages << "\r\n";

    getchar ();



But mailbox contents treee letters, no -1! Help me! Thank your!

P.S. I have mingw 4.6.2, I have chilkatsoft for mingw 4.6.2 (


Per the documentation, -1 indicates a failure (of which kind I am unsure)

int GetMailboxCount(void); Returns the number of emails on the POP3 server, > or -1 for failure.

I believe all Chilkat methods save details about the last error that they encountered. Try inspecting the mailman's LastErrorText member.

Also, see this note about POP3 inbox item counts.


theDonald! Thanks!

1) I had use "std::cout << mailman.lastErrorText() << std::endl;" after "mailman.GetMailboxCount();"

2) I had got very mach string. Among string was one "PopCmdResp: -ERR POP3 is available only with SSL or TLS connection enabled"

3) SSL! I had use


I had take this code here

4) All works good! Thanks again!