1mail::ACCOUNT::addMesmsaaigle:(:3AxC)COUNT Synchronous APImraeifle:r:eAnCcCeOUNT::addMessage(3x)
2
3
4

NAME

6       mail::ACCOUNT::addMessage - Add a message to a folder
7

SYNOPSIS

9       #include <libmail/sync.H>
10
11       #include <libmail/addmessage.H>
12
13       mail::ACCOUNT *mail;
14
15       class myAddMessagePull : public mail::addMessagePull {
16
17       public:
18           std::string getMessageContents();
19       };
20
21       time_t messageDate;
22       mail::messageInfo newMessageInfo;
23       myAddMessagePull message;
24
25           message.messageDate=messageDate;
26           message.newMessageInfo=newMessageInfo;
27
28
29
30       bool ok=mail->addMessage (const mail::folder *folder, message);
31
32       std::string errmsg=mail->getErrmsg();
33

USAGE

35       This  method  inserts  a  message  into a folder.  folder specifies the
36       folder where the message is added to, which may or may not be the  cur‐
37       rently open folder.
38
39       message's  getMessageContents  specifies  the  contents of the message,
40       which should be a valid,  MIME-formatted  message.   getMessageContents
41       does  not  have  to  return the entire contents of the message at once.
42       addMessage  calls  getMessageContents  repeatedly.   getMessageContents
43       should  return the next portion of the message with each call.  getMes‐
44       sageContents should return an empty string, after providing the  entire
45       message  contents  are  provided.   getMessageContents  will  be called
46       repeatedly until it returns an empty string.
47
48       The application  may  set  the  following  mail::addMessagePull  fields
49       before  invoking this method.  If not initialized, the following fields
50       will be set to their default values.
51
52       messageDate
53              The  message's  arrival  timestamp,  which   is   retrieved   by
54              mail::ACCOUNT::getMessageEnvelope(3x),  which  places  it in the
55              arrivalDate field.
56
57              Note: This timestamp does not necessarily have to be the same as
58              the timestamp in the message's Date: header.
59
60       messageInfo
61              The message flags, as returned by mail::ACCOUNT::getFolderIndex‐
62              Info(3x).
63
64              Note: The contents of uid, the message's unique ID, are ignored,
65              only  the  message  flags  in messageInfo are read.  The message
66              gets automatically assigned a new unique ID when it  gets  added
67              to the folder.
68

RETURN CODES

70       This  method returns true if it succeeds, or false if it fails.  If the
71       method fails, use mail::ACCOUNT::getErrmsg() to read a  brief  descrip‐
72       tion of the error.
73

SEE ALSO

75       mail::ACCOUNT::checkNewMail(3x).
76
77
78
79                                 10 April 2006   mail::ACCOUNT::addMessage(3x)
Impressum