login about faq

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)

asked Aug 24 at 14:57

qipik's gravatar image

qipik
112

edited Aug 24 at 14:59


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.

link

answered Aug 30 at 17:28

theDonald's gravatar image

theDonald
462

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!

link

answered Aug 31 at 13:04

qipik's gravatar image

qipik
112

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×184

Asked: Aug 24 at 14:57

Seen: 179 times

Last updated: Aug 31 at 13:04

powered by OSQA