my $f = Mail::Message::Field->new(Cc => 'Mail::Box <mailbox@overmeer.net>'); my $cc = Mail::Message::Field->new('Cc'); $cc->addAddress('Mail::Box <mailbox@overmeer.net>'); $cc->addAddress ( phrase => 'Mail::Box' , email => 'mailbox@overmeer.net' , comment => 'Our mailing list' # deprecated by RFC ); mu $ma = Mail::Message::Field::Address->new(...); $cc->addAddress($ma); my $mi = Mail::Identity->new(...); $cc->addAddress($mi); 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