mail::ACCOUNT::getMessageStructure — Return message MIME structure


#include <libmail/sync.H>

#include <libmail/structure.H>

mail::ACCOUNT *mail;

bool ok=mail->getMessageStructure( const std::vector<size_t> &msgList,
  std::vector<mail::mimestruct> &structures);

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

mail::mimestruct myMimeStruct=mail->getMessageStructure( size_t messageNum);


msgList specifies a list of messages. Messages are numbered starting with message #0 and up to one less than mail::ACCOUNT::getFolderIndexSize(3x) (when mail::account::getFolderIndexSize returns 6, the messages are numbered 0 through 5). Only the messages that appear in msgList are processed by this request. When a message is removed from the folder, by mail::ACCOUNT::updateFolderIndexInfo(3x), the following messages are renumbered accordingly.


Most mail servers allow multiple applications to open the same folder. Therefore, changes to the folder's contents can occur at any time. Before making this request, the application should use mail::ACCOUNT::checkNewMail(3x) to verify that no unexpected changes have been made to the folder's contents.

This function returns the MIME structure information of each message specified by msgList. This function initializes the structures array to the same size as msgList, with each array member containing the MIME structure for the corresponding message in msgList.

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.

The second version of mail::ACCOUNT::getMessageStructure returns the MIME structure of a single message, ignoring any error condition (a failure results in the returned mail::mimestruct object being completely empty).