Overview
Features
Download
Documentation
Community
Add-Ons & Services

recipient list is empty fetching gmail e-mails

Please post support and help requests here.

recipient list is empty fetching gmail e-mails

Postby gorth » 08 Mar 2013, 08:03

I have no problem fetching emails from gmail.com 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();
    session.listMessages(messages);

    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: ";
        else
            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?
gorth
 
Posts: 1
Joined: 08 Mar 2013, 07:47

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.
guenter
 
Posts: 1092
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron