Duplicate the message as a whole. Both header and body will be deep-copied: a new Mail::Internet object is returned.
$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.
The Mail::Header::new() %options Modify
, MailFrom
and FoldLength
may also be given.
Option | Default |
---|---|
Body | [] |
Header |
|
Returns the body of the message. This is a reference to an array. Each entry in the array represents a single line in the message.
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.
Returns the Mail::Header
object which holds the headers for the current
message
Returns the message as a string in mbox format. $already_escaped
, if
given and true, indicates that escape_from() has already been called on
this object.
Returns the message as a single string.
Print only the body to the $fh (default STDOUT).
Print only the header to the $fh (default STDOUT).
Most of these methods are simply wrappers around methods provided by Mail::Header.
The PAIRS are field-name and field-content. For each PAIR, Mail::Header::add() is called. All fields are added after existing fields. The last addition is returned.
Delete all fields with the name $tag. Mail::Header::delete() is doing the work.
See Mail::Header::fold().
In LIST context, all fields with the name $tag are returned. In SCALAR context, only the first field which matches the earliest $tag is returned. Mail::Header::get() is called to collect the data.
The PAIRS are field-name and field-content. For each PAIR, Mail::Header::replace() is called with index 0. If a $field is already in the header, it will be removed first. Do not specified the same field-name twice.
Attempts to remove a user's signature from the body of a message. It does this
by looking for a line equal to '-- '
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.
Add your signature to the body. remove_sig() will strip existing signatures first.
Option | Default |
---|---|
File |
|
Signature | [] |
Removes all leading and trailing lines from the body that only contain white spaces.
It can cause problems with some applications if a message contains a line
starting with `From '
, in particular when attempting to split a folder.
This method inserts a leading `
'> on any line that matches the regular
expression /^
*From/>
Post an article via NNTP. Requires Net::NNTP to be installed.
Option | Default |
---|---|
Debug | <false> |
Host | <required> |
Port | 119 |
Create a new object with header initialised for a reply to the current object. And the body will be a copy of the current message indented.
The .mailhdr
file in your home directory (if exists) will be read
first, to provide defaults.
Option | Default |
---|---|
Exclude | [] |
Indent | '>' |
Keep | [] |
ReplyAll |
|
Send a Mail::Internet message using Mail::Mailer. $type and $args are passed on to Mail::Mailer::new().
Send a Mail::Internet message using direct SMTP to the given
ADDRESSES, each can be either a string or a reference to a list of email
addresses. If none of To
, <Cc> or Bcc
are given then the addresses
are extracted from the message being sent.
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.
Requires Net::SMTP and Net::Domain to be installed.
Option | Default |
---|---|
Bcc |
|
Cc |
|
Debug | <false> |
Hello |
|
Host |
|
MailFrom |
|
Port | 25 |
To |
|
Remove the escaping added by escape_from().