|
Mail::Internet - manipulate Internet format mail messages |
Mail::Internet - manipulate Internet format (RFC 822) mail messages
use Mail::Internet;
This package provides a class object which can be used for reading, creating, manipulating and writing a message with RFC822 compliant headers.
If you start writing a new application, you may want to use the the Mail::Box manpage set of packages (requires perl 5.6.1), which has more features and handles modern messages much better. See http://perl.overmeer.net/mailbox/.
ARG is optional and may be either a file descriptor (reference to a GLOB)
or a reference to an array. If given the new object will be
initialized with headers and body either from the array of read from
the file descriptor.
OPTIONS is a list of options given in the form of key-value
pairs, just like a hash table. Valid options are
Mail::Header object. If given then
Mail::Internet will not attempt to read a mail header from ARG, if
it was specified.
\n (LF). If Body is given then Mail::Internet will not attempt to
read the body from ARG (even if it is specified).
The Mail::Header options Modify, MailFrom and FoldLength may
also be given.
If BODY is given, it can be a reference to an array or an array, then the body will be replaced. If a reference is passed, it is used directly and not copied, so any subsequent changes to the array will change the contents of the body.
$mail->print( \*STDOUT ); # Print message to STDOUT
ALREADY_ESCAPED, if
given and true, indicates that ->escape_from has already been called on
this object.
Mail::Header object which holds the headers for the current
message
The following methods are more a utility type than a manipulation type of method.
'-- ' within the last NLINES of the
message. If found then that line and all lines after it will be removed. If
NLINES is not given a default value of 10 will be used. This would be of
most use in auto-reply scripts.
FILE is a file which contains
the signature, if not given then the file ``$ENV{HOME}/.signature''
will be checked for.
Mail::Mailer
The return value will be a list of email addresses that the message was sent to. If the message was not sent the list will be empty.
Options are passed as key-value pairs. Current options are
If Host is not given then the SMTP host is found by attempting
connections first to hosts specified in $ENV{SMTPHOSTS}, a colon
separated list, then mailhost and localhost.
mailaddress()
method provides the address of the sender.
To, <Cc> or Bcc
are given then the addresses are extracted from the message being sent.
Options are passed as key-value pairs. Current options are
`From ', in particular when attempting to split a folder.
This method inserts a leading `'> on anyline that matches the regular
expression /^*From/>
the Mail::Header manpage the Mail::Address manpage
Graham Barr. Maintained by Mark Overmeer <mailtools@overmeer.net>
Copyright (c) 2002-2003 Mark Overmeer, 1995-2001 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
Mail::Internet - manipulate Internet format mail messages |