1MAIL::HEADER::LIST(3x) Cone: COnsole Newsreader And E MAIL::HEADER::LIST(3x)
2
3
4
6 mail::Header::list - Create a list of headers.
7
9 #include <libmail/headers.H>
10
11 mail::Header::list headers;
12
13 headers << mail::Header::encoded("Subject", "Hello", "iso-8859-1")
14 << mail::header::addresslist("To")
15 ("John", "john@example.com")
16 ("Tom", "tom@example.com")
17 << mail::Header::mime("Content-Type", "text/plain")
18 ("charset", "iso-8859-1");
19
20 std::cout << (std::string)headers;
21
22
24 This is a helper class for formatting a list of headers. Each header is
25 specified, using the << operator, which can take any combination of
26 mail::Header::addresslist(3x), mail::Header::encoded(3x),
27 mail::Header::mime(3x), or mail::Header::plain(3x).
28
29 Note
30 The << operator makes an internal copy of the header object. The
31 original object may be destroyed after the operator returns.
32
33 The std::string operator formats all headers, and returns the set of
34 E-mail headers as a single string. Long headers are folded accordingly.
35
37 mail::Header::addresslist(3x), mail::Header::encoded(3x),
38 mail::Header::mime(3x), mail::Header::plain(3x).
39
40
41
42[FIXME: source] 05/08/2010 MAIL::HEADER::LIST(3x)