Question:
Fryiends! I speak English very bad, so I am sorry
I vave mailbox: aprol_89@mail.ru 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
mailman.put_MailHost("pop.mail.ru");
// Set the POP3 login/password.
mailman.put_PopUsername("aprol_89");
mailman.put_PopPassword("Baq0L,/lRX");
// Get the number of messages in the mailbox.
int numMessages;
numMessages = mailman.GetMailboxCount();
std::cout << numMessages << "\r\n";
getchar ();
}
Output:
-1
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 (https://www.chilkatsoft.com/download/9.5.0.58/chilkat-9.5.0-mingw-32-4.6.2.zip)
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
mailman.put_MailPort(995);
mailman.put_PopSsl(true);
I had take this code here
4) All works good! Thanks again!