Nick Wellnhofer > Email-MIME-RFC2047-0.91 > Email::MIME::RFC2047::Mailbox

Download:
Email-MIME-RFC2047-0.91.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.91   Source  

NAME ^

Email::MIME::RFC2047::Mailbox - Handling of MIME encoded mailboxes

SYNOPSIS ^

 use Email::MIME::RFC2047::Mailbox;

 my $mailbox = Email::MIME::RFC2047::Mailbox->parse($string);
 print $mailbox->name(), "\n";
 print $mailbox->address(), "\n";

 my $mailbox = Email::MIME::RFC2047::Mailbox->new(
    name => $name,
    address => $address,
 );
 $email->header_set('To', $mailbox->format());

DESCRIPTION ^

This module handles RFC 2822 'mailboxes'.

CLASS METHODS ^

parse

 my $mailbox = Email::MIME::RFC2047::Mailbox->parse($string, [$decoder])

Parse a RFC 2822 'mailbox'. Returns a Email::MIME::RFC2047::Mailbox object.

CONSTRUCTOR ^

new

 my $mailbox = Email::MIME::RFC2047::Mailbox->new(
    name => $name,
    address => $address,
 );

Creates a new Email::MIME::RFC2047::Mailbox object, optionally with a display name $name and an email address $address.

METHODS ^

name

 my $name = $mailbox->name();
 $mailbox->name($new_name);

Gets or sets the display name of the mailbox.

address

 my $address = $mailbox->address();
 $mailbox->address($new_address);

Gets or sets the email address of the mailbox.

format

 my $string = $mailbox->format([$encoder]);

Returns the formatted mailbox string for use in a message header.

$encoder is an optional Email::MIME::RFC2047::Encoder object used for encoding display names with non-ASCII characters.

AUTHOR ^

Nick Wellnhofer <wellnhofer@aevum.de>

COPYRIGHT AND LICENSE ^

Copyright (C) Nick Wellnhofer, 2009

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: