1mail::ACCOUNT::getMesmsaaigle:C:oAnCtCeOnUtN(T3xS)ynchronomuasilA:P:IACrCeOfUeNrTe:n:cgeetMessageContent(3x)
2
3
4

NAME

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

SYNOPSIS

9       #include <libmail/sync.H>
10
11
12       class myStoreCallback : public mail::ACCOUNT::Store {
13
14       public:
15           void search(size_t messageNumber, std::string messageContents);
16       };
17
18       myStoreCallback storeCallback;
19
20       mail::ACCOUNT *mail;
21
22
23
24       bool  ok=mail->getMessageContent  (const  std::vector<size_t> &msgList,
25       bool peek, mail::readMode requestType, storeCallback);
26
27
28
29       bool ok=mail->getMessageContent (size_t messageNum,  bool  peek,  const
30       mail::mimestruct  &messagePart,  mail::readMode requestType, storeCall‐
31       back);
32
33       std::string errmsg=mail->getErrmsg();
34

USAGE

36       mail::ACCOUNT::getMessagesContent reads messages in the currently  open
37       folder.  There are two alternative versions of this method.
38
39       · The  first  version receives a list of message numbers.  This version
40         is capable of returning headers and/or content of multiple messages.
41
42         msgList specifies a list of messages.  Messages are numbered starting
43         with   message  #0  and  up  to  one  less  than  mail::ACCOUNT::get‐
44         FolderIndexSize(3x) (when  mail::account::getFolderIndexSize  returns
45         6,  the  messages  are numbered 0 through 5).  Only the messages that
46         appear in msgList are processed by this request.  When a  message  is
47         removed from the folder, by mail::ACCOUNT::updateFolderIndexInfo(3x),
48         the following messages are renumbered accordingly.
49
50         Note: Most mail servers allow multiple applications to open the  same
51         folder.  Therefore, changes to the folder's contents can occur at any
52         time.   Before  making  this  request,  the  application  should  use
53         mail::ACCOUNT::checkNewMail(3x)  to verify that no unexpected changes
54         have been made to the folder's contents.
55
56       · The  second  version  receives  a  single  message  number,   and   a
57         mail::mimestruct  object that refers to a single MIME attachment or a
58         section of this message.  The mail::mimestruct object was  previously
59         obtained  from  mail::ACCOUNT::getMessageStructure(3x), for this mes‐
60         sage.  This method  returns  a  recursive  tree  of  mail::mimestruct
61         objects which enumerates the individual MIME sections in the message.
62         messagePart must be a reference to one of these objects (or to a copy
63         of these objects).
64
65       Setting  peek to true does not reset the unread message status flag for
66       this message.  Otherwise the unread message status flag will be reset.
67
68       storeCallback's store method receives the requested content,  which  is
69       determined by the remaining parameters.
70
71       requestType  identifies  the  type  of  information  to return from the
72       selected MIME section, and must be set to one of the following values:
73
74       mail::readHeadersFolded
75              Return only the headers of the MIME section.  Folded headers are
76              unfolded (the newline and the leading space on the next line are
77              replaced with a single space character).
78
79       mail::readHeaders
80              Return only the headers of the MIME section.   The  headers  are
81              returned as-is, without unfolding them.
82
83       mail::readContents
84              Return the content of the MIME section.
85
86              Note: The MIME section is not decoded.  Check the Content-Trans‐
87              fer-Encoding header to know what you're getting.
88
89       mail::readBoth
90              Return the entire MIME section, as  is:  its  headers,  a  blank
91              line, then the contents.
92
93       The  callback  method  may  not receive the entire requested content at
94       once.  Typically the method will be invoked multiple times;  each  time
95       the  method  receives  the next portion of the requested content.  When
96       requesting headers and/or content of multiple  messages,  they  may  be
97       returned  in any order, and the messageNumber parameter indicates which
98       message's contents are being returned (note, however, that  the  entire
99       contents  of  a given message are returned in their entirety, even when
100       the callback method gets  invoked  multiple  times  for  that  message,
101       before content from the next message are returned).
102

RETURN CODES

104       This  method returns true if it succeeds, or false if it fails.  If the
105       method fails, use mail::ACCOUNT::getErrmsg() to read a  brief  descrip‐
106       tion of the error.
107

SEE ALSO

109       mail::ACCOUNT::getMessageContentDecoded(3x),     mail::ACCOUNT::getMes‐
110       sageEnvelope(3x), mail::ACCOUNT::getMessageStructure(3x).
111
112
113
114                                 10 April 2m0a0i6l::ACCOUNT::getMessageContent(3x)
Impressum