mail::ACCOUNT::getMessageContent

Name

mail::ACCOUNT::getMessageContent -- Read message content

Synopsis

#include <libmail/sync.H>


class myStoreCallback : public mail::ACCOUNT::Store {

public:
    void search(size_t messageNumber, std::string messageContents);
};

myStoreCallback storeCallback;

mail::ACCOUNT *mail;

bool ok=mail->getMessageContent(const std::vector<size_t> &msgList, bool peek, bool justHeader, bool justContents, storeCallback);

bool ok=mail->getMessageContent(size_t messageNum, bool peek, const mail::mimestruct &messagePart, bool justHeader, bool justContents, storeCallback);

std::string errmsg=mail->getErrmsg();

USAGE

mail::ACCOUNT::getMessagesContent reads messages in the currently open folder. There are two alternative versions of this method.

Setting peek to true does not reset the unread message status flag for this message. Otherwise the unread message status flag will be reset.

storeCallback's store method receives the requested content, which is determined by the remaining parameters.

justHeader requests only the header portion of a message or a MIME attachment; justContents requests the contents of a MIME section. Both the header and the contents may be requested to receive the entire message or MIME attachment. Multi-line headers are automatically folded when only the headers are requested (but not when both headers and contetn are requested).

The callback method may not receive the entire requested content at once. Typically the method will be invoked multiple times; each time the method receives the next portion of the requested content. When requesting headers and/or content of multiple messages, they may be returned in any order, and the messageNumber parameter indicates which message's contents are being returned (note, however, that the entire contents of a given message are returned in their entirety, even when the callback method gets invoked multiple times for that message, before content from the next message are returned).

Return Codes

This method returns true if it succeeds, or false if it fails. If the method fails, use mail::ACCOUNT::getErrmsg() to read a brief description of the error.

SEE ALSO

mail::ACCOUNT::getMessageContentDecoded(3x), mail::ACCOUNT::getMessageEnvelope(3x), mail::ACCOUNT::getMessageStructure(3x).