The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mail::Exchange::Recipient - class to handle message recipients

SYNOPSIS

    use Mail::Exchange::Recipient;

    my $recipient=Mail::Exchange::Recipient->new();
    $recipient->setEmailAddress('gbl@bso2001.com');
    $recipient->setDisplayName('Guntram Blohm <gbl@bso2001.com>');
    $message->addRecipient($recipient);

DESCRIPTION

A Mail::Exchange::Recipient object reflects the data that Mail::Exchange::Recipient uses to add a recipient to a message. Since a message has only one sender, but possibly multiple recipients, the recipient data isn't stored in message properties (like sender data is), instead, a message has zero or more recipient objects attached.

new()

$msg=Mail::Exchange::Recipient->new()

Create a recipient object.

setRecipientType()

$recipient->setRecipientType(type)

Sets the type of recipient, which can be 1 for "To", 2 for "CC", or 3 for "BCC". For convenience, the strings "to", "cc" and "bcc", case-insensitive, are recognized as well.

setAddressType()

$recipient->setRecipientType(type)

Sets the address type of the recipient, which is "SMTP" normally, but may have different values as well depending on transmission type. For example, the Microsoft Exchange server uses "EX".

setDisplayName()

$recipient->setDisplayName(name)

Sets the display name of the recipient. This may be something like "Guntram Blohm <gbl@bso2001.com>" for SMTP recipients, or just "Blohm, Guntram" for transport within an Exchange Domain.

setSMTPAddress()

$recipient->setSMTPAddress(name)

Sets the SMTP Address of the recipient. This should be an SMTP address, even if the address type is not SMTP.

setEmailAddress()

$recipient->setEmailAddress(name)

Sets the Email Address of the recipient. This can be an SMTP address, if the address type is SMTP, or a differently formatted address, if you're using a different Address Type. This sets the SMTP Address as well, so if you're using this method for non-SMTP-Adresses, you should call setSMTPAddress afterwards.