Scroll to navigation

Debbugs::Mail(3pm) User Contributed Perl Documentation Debbugs::Mail(3pm)

NAME

Debbugs::Mail -- Outgoing Mail Handling

SYNOPSIS

use Debbugs::Mail qw(send_mail_message get_addresses);

my @addresses = get_addresses('blah blah blah foo@bar.com') send_mail_message(message => <<END, recipients=>[@addresses]); To: $addresses[0] Subject: Testing

Testing 1 2 3 END

EXPORT TAGS

:all -- all functions that can be exported

FUNCTIONS

get_addresses

     my @addresses = get_addresses('don@debian.org blars@debian.org
                                    kamion@debian.org ajt@debian.org');

Given a string containing some e-mail addresses, parses the string using Mail::Address->parse and returns a list of the addresses.

default_headers

      my @head = default_headers(queue_file => 'foo',
                                 data       => $data,
                                 msgid      => $header{'message-id'},
                                 msgtype    => 'error',
                                 headers    => [...],
                                );
      create_mime_message(\@headers,
                         ...
                         );

This function is generally called to generate the headers for create_mime_message (and anything else that needs a set of default headers.)

In list context, returns an array of headers. In scalar context, returns headers for shoving in a mail message after encoding using encode_headers.

options

default headers

send_mail_message

     send_mail_message(message    => $message,
                       recipients => [@recipients],
                       envelope_from => 'don@debian.org',
                      );
encode_headers -- encode headers using RFC1522 (default)

Returns true on success, false on failures. All errors are indicated using warn.

encode_headers

     $message = encode_heeaders($message);

RFC 1522 encodes the headers of a message

rfc822_date

     rfc822_date

Return the current date in RFC822 format in the UTC timezone

PRIVATE FUNCTIONS

_send_message

     _send_message($message,@sendmail_args);

Private function that actually calls sendmail with @sendmail_args and sends message $message.

dies with errors, so calls to this function in send_mail_message should be wrapped in eval.

2010-08-06 perl v5.10.0