recipient list is empty fetching gmail e-mails

Please post support and help requests here.
Posts: 1
Joined: 08 Mar 2013, 07:47

recipient list is empty fetching gmail e-mails

Postby gorth » 08 Mar 2013, 08:03

I have no problem fetching emails from pop3 SSL MTA - the basic
SSL e-mail fetch loop:

Code: Select all

    vector<POP3ClientSession::MessageInfo>::const_iterator i;
    session.login("username", "password");
    POP3ClientSession::MessageInfoVec messages;

    int idx, count = session.messageCount();

    for (idx = 0, i = messages.begin(); i != messages.end(); ++i, idx++)
        MailMessage message;
        session.retrieveMessage((*i).id, message);

and for any given message, all fields (subject, from, body, etc) are fine except the
recipient list:

Code: Select all

    const MailMessage em;
    int idx, got_to = FALSE;
    const MailMessage::Recipients curr_to = em.recipients();
    vector<MailRecipient>::const_iterator i;

    for (idx = 0, i = curr_to.begin(); i != curr_to.end(); i++, idx++)
        if (!idx)
            s += "To: ";
            s += ", ";
        s += i->getAddress().c_str();
        got_to = TRUE;

irregardless of the number and type of recipients (which look fine in gmail headers),
the loop above is never entered. iterator i always evaluates to "curr_to.end()" indicating
0 elements. Am I doing something inherently wrong? anyone else experience this problem?

Posts: 1266
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: recipient list is empty fetching gmail e-mails

Postby guenter » 08 Mar 2013, 21:38

The recipient list is not set when downloading a message, it is only used when sending a message. You'll have to check the To and Bcc headers yourself.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest