my $cc = Mail::Message::Field::Full->new('Cc'); my $me = Mail::Message::Field::Address->parse('"Test" <test@mail.box>') or die; my $other = Mail::Message::Field::Address->new(phrase => 'Other' , address => 'other@example.com') or die; $cc->addAddress($me); $cc->addAddress($other, group => 'them'); $cc->addAddress(phrase => 'third', address => 'more@any.museum' , group => 'them'); my $group = $cc->addGroup(name => 'collegues'); $group->addAddress($me); $group->addAddress(phrase => "You", address => 'you@example.com'); my $msg = Mail::Message->build(Cc => $cc); print $msg->string; my $g = Mail::Message::Field::AddrGroup->new(...); $cc->addGroup($g);
See SYNOPSIS in Mail::Message::Field::Structured
All header fields which contain e-mail addresses only. Not all address fields have the same possibilities, but they are all parsed the same: you never know how broken the applications are which produce those messages.
When you try to create constructs which are not allowed for a certain kind of field, you will be warned.
See DESCRIPTION in Mail::Message::Field::Full
See Field syntax in Mail::Message::Field
See Folding fields in Mail::Message::Field
See Structured fields in Mail::Message::Field
See Comments in fields in Mail::Message::Field
See Getting a field in Mail::Message::Field
See Using get() field in Mail::Message::Field
See Using study() field in Mail::Message::Field
See Using resent groups in Mail::Message::Field
See The field's data in Mail::Message::Field
See Access to the field in Mail::Message::Field
See Using simplified field access in Mail::Message::Field
See Specifying field data in Mail::Message::Field