man-pages/man3/Mail::Field::AddrList.3pm.html
2021-03-31 01:06:50 +01:00

280 lines
6.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Mail::Field::AddrList</TITLE>
</HEAD><BODY>
<H1>Mail::Field::AddrList</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-07-25<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
Mail::Field::AddrList - object representation of e-mail address lists
<A NAME="lbAC">&nbsp;</A>
<H2>INHERITANCE</H2>
<PRE>
Mail::Field::AddrList
is a Mail::Field
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
use Mail::Field::AddrList;
$to = Mail::Field-&gt;new('To');
$from = Mail::Field-&gt;new('From', '<A HREF="mailto:poe@daimi.aau.dk">poe@daimi.aau.dk</A> (Peter Orbaek)');
$from-&gt;create('<A HREF="mailto:foo@bar.com">foo@bar.com</A>' =&gt; 'Mr. Foo', poe =&gt; 'Peter');
$from-&gt;parse('<A HREF="mailto:foo@bar.com">foo@bar.com</A> (Mr Foo), Peter Orbaek &lt;poe&gt;');
# make a RFC822 header string
print $from-&gt;stringify(),&quot;\n&quot;;
# extract e-mail addresses and names
@addresses = $from-&gt;addresses(); # strings
@names = $from-&gt;names(); # strings
@addr = $from-&gt;addr_list(); # Mail::Address objects (v2.00)
# adjoin a new address to the list
$from-&gt;set_address('<A HREF="mailto:foo@bar.com">foo@bar.com</A>', 'Mr. Foo');
</PRE>
<A NAME="lbAE">&nbsp;</A>
<H2>DESCRIPTION</H2>
Defines parsing and formatting of address field, for the following
fields: <TT>&quot;To&quot;</TT>, <TT>&quot;From&quot;</TT>, <TT>&quot;Cc&quot;</TT>, <TT>&quot;Reply-To&quot;</TT>, and <TT>&quot;Sender&quot;</TT>.
<P>
All the normally used features of the address field specification of
<FONT SIZE="-1">RFC2822</FONT> are implemented, but some complex (and therefore hardly ever used)
constructs will not be understood. Use Mail::Message::Field::Full
in MailBox if you need full <FONT SIZE="-1">RFC</FONT> compliance.
<P>
Extends ``<FONT SIZE="-1">DESCRIPTION''</FONT> in Mail::Field.
<A NAME="lbAF">&nbsp;</A>
<H2>METHODS</H2>
Extends ``<FONT SIZE="-1">METHODS''</FONT> in Mail::Field.
<A NAME="lbAG">&nbsp;</A>
<H3>Constructors</H3>
Extends ``Constructors'' in Mail::Field.
<DL COMPACT>
<DT id="1">Mail::Field::AddrList-&gt;<B>combine</B>($fields)<DD>
Inherited, see ``Constructors'' in Mail::Field
<DT id="2">Mail::Field::AddrList-&gt;<B>extract</B>( $tag, $head [, $index ] )<DD>
Inherited, see ``Constructors'' in Mail::Field
<DT id="3">Mail::Field::AddrList-&gt;<B>new</B>( $tag [, <FONT SIZE="-1">STRING</FONT> | %options] )<DD>
Inherited, see ``Constructors'' in Mail::Field
</DL>
<A NAME="lbAH">&nbsp;</A>
<H3>Fake constructors</H3>
Extends &quot;``Fake'' constructors&quot; in Mail::Field.
<DL COMPACT>
<DT id="4">$obj-&gt;<B>create</B>(%options)<DD>
Inherited, see &quot;``Fake'' constructors&quot; in Mail::Field
<DT id="5">$obj-&gt;<B>parse</B>()<DD>
Inherited, see &quot;``Fake'' constructors&quot; in Mail::Field
</DL>
<A NAME="lbAI">&nbsp;</A>
<H3>Accessors</H3>
Extends ``Accessors'' in Mail::Field.
<DL COMPACT>
<DT id="6">$obj-&gt;<B>set</B>(%options)<DD>
Inherited, see ``Accessors'' in Mail::Field
<DT id="7">$obj-&gt;<B>stringify</B>()<DD>
Inherited, see ``Accessors'' in Mail::Field
<DT id="8">$obj-&gt;<B>tag</B>()<DD>
<DT id="9">Mail::Field::AddrList-&gt;<B>tag</B>()<DD>
Inherited, see ``Accessors'' in Mail::Field
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H3>Smart accessors</H3>
Extends ``Smart accessors'' in Mail::Field.
<DL COMPACT>
<DT id="10">$obj-&gt;<B>addr_list</B>()<DD>
Returns the collected Mail::Address objects.
<DT id="11">$obj-&gt;<B>addresses</B>()<DD>
Returns a list if email addresses, found in the field content.
<DT id="12">$obj-&gt;<B>names</B>()<DD>
Returns a list of nicely formatted named, for each of the addresses
found in the content.
<DT id="13">$obj-&gt;<B>set_address</B>($email, $name)<DD>
Add/replace an <TT>$email</TT> address to the field.
<DT id="14">$obj-&gt;<B>text</B>( [<FONT SIZE="-1">STRING</FONT>] )<DD>
Inherited, see ``Smart accessors'' in Mail::Field
</DL>
<A NAME="lbAK">&nbsp;</A>
<H2>DETAILS</H2>
Extends ``<FONT SIZE="-1">DETAILS''</FONT> in Mail::Field.
<A NAME="lbAL">&nbsp;</A>
<H2>DIAGNOSTICS</H2>
<DL COMPACT>
<DT id="15">Error: Undefined subroutine &lt;method&gt; called<DD>
Mail::Field objects use autoloading to compile new functionality.
Apparently, the method called is not implemented for the specific
class of the field object.
</DL>
<A NAME="lbAM">&nbsp;</A>
<H2>SEE ALSO</H2>
This module is part of the MailTools distribution,
<I><A HREF="http://perl.overmeer.net/mailtools/">http://perl.overmeer.net/mailtools/</A></I>.
<A NAME="lbAN">&nbsp;</A>
<H2>AUTHORS</H2>
The MailTools bundle was developed by Graham Barr. Later, Mark
Overmeer took over maintenance without commitment to further development.
<P>
Mail::Cap by Gisle Aas &lt;<A HREF="mailto:aas@oslonett.no">aas@oslonett.no</A>&gt;.
Mail::Field::AddrList by Peter Orbaek &lt;<A HREF="mailto:poe@cit.dk">poe@cit.dk</A>&gt;.
Mail::Mailer and Mail::Send by Tim Bunce &lt;<A HREF="mailto:Tim.Bunce@ig.co.uk">Tim.Bunce@ig.co.uk</A>&gt;.
For other contributors see ChangeLog.
<A NAME="lbAO">&nbsp;</A>
<H2>LICENSE</H2>
Copyrights 1995-2000 Graham Barr &lt;<A HREF="mailto:gbarr@pobox.com">gbarr@pobox.com</A>&gt; and
2001-2017 Mark Overmeer &lt;<A HREF="mailto:perl@overmeer.net">perl@overmeer.net</A>&gt;.
<P>
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See <I><A HREF="http://www.perl.com/perl/misc/Artistic.html">http://www.perl.com/perl/misc/Artistic.html</A></I>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="16"><A HREF="#lbAB">NAME</A><DD>
<DT id="17"><A HREF="#lbAC">INHERITANCE</A><DD>
<DT id="18"><A HREF="#lbAD">SYNOPSIS</A><DD>
<DT id="19"><A HREF="#lbAE">DESCRIPTION</A><DD>
<DT id="20"><A HREF="#lbAF">METHODS</A><DD>
<DL>
<DT id="21"><A HREF="#lbAG">Constructors</A><DD>
<DT id="22"><A HREF="#lbAH">Fake constructors</A><DD>
<DT id="23"><A HREF="#lbAI">Accessors</A><DD>
<DT id="24"><A HREF="#lbAJ">Smart accessors</A><DD>
</DL>
<DT id="25"><A HREF="#lbAK">DETAILS</A><DD>
<DT id="26"><A HREF="#lbAL">DIAGNOSTICS</A><DD>
<DT id="27"><A HREF="#lbAM">SEE ALSO</A><DD>
<DT id="28"><A HREF="#lbAN">AUTHORS</A><DD>
<DT id="29"><A HREF="#lbAO">LICENSE</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:47 GMT, March 31, 2021
</BODY>
</HTML>