1mail::Header::addresslist(3x)  Creating headers  mail::Header::addresslist(3x)
2
3
4

NAME

6       mail::Header::addresslist - An E-mail header that contains addresses.
7

SYNOPSIS

9       #include <libmail/headers.H>
10
11       std::vector<mail::emailAddress> address_list;
12       mail::emailAddress addr;
13
14       mail::Header::addresslist tohdr("To", address_list);
15
16       mail::Header::addresslist cchdr("Cc")("John", "john@example.com")
17                                            ("Tom", "tom@example.com")
18                                            (addr);
19
20       std::cout << tohdr.toString();
21

USAGE

23       This  class  creates  a  header  that  contains  addresses, such as the
24       ``To:'' or the ``Cc:'' header.  Two arguments are provided to the  con‐
25       structor: the header's name, and a vector containing the addresses.
26
27       This  is  not  the appropriate class to create structured MIME headers.
28       Use mail::Header::mime(3x) to create structured MIME headers.
29
30       The toString() returns the header as  a  single  text  string:  ``name:
31       value''.  Long headers are folded accordingly.
32
33   DYNAMIC ADDRESS LIST GENERATION
34       This class has an alternative constructor that receives a single param‐
35       eter: the header's name, which initializes an empty address list.   The
36       address list is populated by repeatedly calling the ``()'' operator.
37
38       One  version  of  the  ``()''  operator  receives the explicit name and
39       address  components   of   an   E-mail   address.    Alternatively,   a
40       mail::emailAddress object may be provided.
41

SEE ALSO

43       mail::Header::encoded(3x),                      mail::Header::list(3x),
44       mail::Header::mime(3x), mail::Header::plain(3x).
45
46
47
48                                 10 April 2006   mail::Header::addresslist(3x)
Impressum