1 ConeĀ©
2
3MAIL::ACCOUNT::GETSE(3x)Cone: COnsole Newsreader And EMAIL::ACCOUNT::GETSE(3x)
4
5
6
8 mail::account::getSendFolder - Create a folder object for sending mail
9
11 #include <libmail/mail.H>
12
13
14 class myCallback : public mail::callback {
15 public:
16 void success(std::string msg);
17 void fail(std::string msg);
18 };
19
20
21 #include <libmail/smtpinfo.H>
22 #include <libmail/addmessage.H>
23
24 mail::account *account;
25
26 mail::smtpInfo info;
27
28 info.sender="nobody@example.com";
29
30 info.recipients.push_back("recipient@example.com");
31
32
33 mail::folder *folder=account->getSendFolder(const mail::smtpInfo &info,
34 const mail::folder *saveFolder,
35 std::string errmsg);
36
37 myCallback sendCallback;
38
39 mail::addMessage *addMessage= folder->addMessage(sendCallback);
40
41 addMessage->saveMessageContents(std::string messageText);
42 addMessage->go();
43
45 This function creates a special folder object: copying a message to
46 this folder will E-mail it to the designated recipient list. The
47 mail::account object must be an account that's capable of creating this
48 kind of a folder (such as smtp accounts created by
49 mail::account::open(3x)). The message may be manually added to the
50 folder with mail::folder::addmessage(3x), or by copying a message from
51 another folder using mail::folder::copyMessagesTo(3x).
52
53 Note
54 Multiple messages may be copied to this mail::folder. Each messages
55 is E-mail separately, to all recipients. Excersize caution to
56 prevent an accidental request to copy an entire folder, with
57 thousand messages, to a thousand recipients.
58
59 saveFolder
60 saveFolder, if not NULL, specifies that a copy of the message should
61 also be saved in this folder. If this mail account uses the
62 experimental SMAP protocol, a single copy of the message will be
63 transmitted to the SMAP server, which will file the message in the
64 folder, and send it to the designated recipients. Otherwise the message
65 is manually saved to this folder using mail::folder::addMessage(3x), or
66 mail::ACCOUNT::addMessage(3x).
67
68 The mail::smtpInfo object
69 info specifies the following parameters which are used to deliver the
70 message:
71
72 class mail::smtpInfo {
73 public:
74 std::string sender;
75
76 std::vector<std::string> recipients;
77
78 std::map<std::string, std::string> options;
79 } ;
80
81 sender specifies the sender's E-mail address, in the form of
82 "user@domain". recipients is a list of recipients' E-mail addresses.
83 At least one recipient must be specified.
84
85 options specifies additional parameters for sending E-mail, initialized
86 as follows:
87
88 options.insert(make_pair("novalidate-cert", "1"))
89 See mail::account::open(3x)) for a description of this option.
90
91 options.insert(make_pair("cram", "1"))
92 See mail::account::open(3x)) for a description of this option.
93
94 options.insert(make_pair("DSN", "list"))
95 Request a delivery status notification. list is a comma-separated
96 list of the following keywords: "never" - do not request any
97 receipts, not even non-delivery notices; "success" - request a
98 delivery confirmation receipt; "fail" - request a non-delivery
99 notice; "delay" - request a delayed delivery notice.
100
101 Note
102 An error will be reported if the mail server does not implement
103 delivery status notifications.
104
105 options.insert(make_pair("RET", "hdrs"))
106 Request that the delivery status notification should not include
107 the entire original message, only its headers.
108
109 options.insert(make_pair("RET", "full"))
110 Request that the delivery status notifications should include the
111 entire original message.
112
113 options.insert(make_pair("NOPIPELINING", "1"))
114 Do not use the PIPELININGSMTP extension even if the mail server
115 claims to support it (workaround for buggy firewalls).
116
117 options.insert(make_pair("VERP", "1"))
118 Use the VERP mailing list extension. If the sender address is
119 "sender@senddomain", then a delivery status notification for
120 "recipient@recipientdomain" will be sent to
121 "sender-recipient=recipientdomain@senddomain" (with certain
122 additional details). This option is currently implemented only by
123 the Courier mail server[1].
124
125 options.insert(make_pair("SECURITY", "STARTTLS"))
126 The message must be sent via TLS, and the recipient's server must
127 present a certificate signed by a trusted, private, certificate
128 authority. This option is currently implemented only by the Courier
129 mail server[1].
130
131 Note
132 This is not the standard STARTTLSESMTP extension. STARTTLS is
133 always used automatically, if it's supported by the mail
134 server.
135
137 mail::account::getSendFolder returns NULL if this mail::account object
138 is not capable of sending mail. errmsg is initialized with an
139 appropriate error message.
140
142 mail::account::open(3x).
143
145 Sam Varshavchik
146
148 1. Courier mail server
149 http://www.courier-mta.org
150
151
152
153ConeĀ© 08/25/2016 MAIL::ACCOUNT::GETSE(3x)