1mail::Header::list(3x) Creating headers 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
23 This is a helper class for formatting a list of headers. Each header
24 is specified, using the << operator, which can take any combination of
25 mail::Header::addresslist(3x), mail::Header::encoded(3x),
26 mail::Header::mime(3x), or mail::Header::plain(3x).
27
28 Note: The << operator makes an internal copy of the header
29 object. The original object may be destroyed after the operator
30 returns.
31
32 The std::string operator formats all headers, and returns the set of E-
33 mail headers as a single string. Long headers are folded accordingly.
34
36 mail::Header::addresslist(3x), mail::Header::encoded(3x),
37 mail::Header::mime(3x), mail::Header::plain(3x).
38
39
40
41 10 April 2006 mail::Header::list(3x)