summaryrefslogtreecommitdiff
path: root/cpan/lib/Mail/Internet.pm
diff options
context:
space:
mode:
Diffstat (limited to 'cpan/lib/Mail/Internet.pm')
-rw-r--r--cpan/lib/Mail/Internet.pm30
1 files changed, 20 insertions, 10 deletions
diff --git a/cpan/lib/Mail/Internet.pm b/cpan/lib/Mail/Internet.pm
index 57c0e962..6b1157ba 100644
--- a/cpan/lib/Mail/Internet.pm
+++ b/cpan/lib/Mail/Internet.pm
@@ -1,7 +1,7 @@
# Mail::Internet.pm
#
-# Copyright (c) 1995-8 Graham Barr <gbarr@pobox.com>. All rights
-# reserved. This program is free software; you can redistribute it and/or
+# Copyright (c) 1995-2001 Graham Barr <gbarr@pobox.com>. All rights reserved.
+# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
@@ -16,7 +16,7 @@ use Mail::Header;
use vars qw($VERSION);
BEGIN {
- $VERSION = "1.33";
+ $VERSION = "1.52";
*AUTOLOAD = \&AutoLoader::AUTOLOAD;
unless(defined &UNIVERSAL::isa) {
@@ -109,7 +109,7 @@ sub body
if(@_)
{
my $new = shift;
- $me->{'mail_inet_body'} = ref($new) eq 'ARRAY' ? $new : [ $new ];
+ $me->{'mail_inet_body'} = ref($new) eq 'ARRAY' ? $new : [ $new, @_ ];
}
return $body;
@@ -533,9 +533,10 @@ sub _prephdr {
$hdr->delete('Received');
- $hdr->replace('X-Mailer', "Perl5 Mail::Internet v" . $Mail::Internet::VERSION);
+ $hdr->replace('X-Mailer', "Perl5 Mail::Internet v".$Mail::Internet::VERSION)
+ unless $hdr->count('X-Mailer');
- my $name = eval { local $SIG{__DIE__}; (getpwuid($>))[6] } || $ENV{NAME} || "";
+ my $name = eval {local $SIG{__DIE__}; (getpwuid($>))[6]} || $ENV{NAME} ||"";
while($name =~ s/\([^\(\)]*\)//) { 1; }
@@ -549,7 +550,7 @@ sub _prephdr {
my $tag;
- foreach $tag (qw(From Sender)) {
+ foreach $tag (qw(From Sender)) { # Sender is deprecated
$hdr->add($tag,$from)
unless($hdr->get($tag));
}
@@ -745,6 +746,10 @@ Mail::Internet - manipulate Internet format (RFC 822) mail messages
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
+L<Mail::Box> set of packages (requires perl 5.6.1), which has more
+features. See http://perl.overmeer.net/mailbox.
+
=head1 CONSTRUCTOR
=over 4
@@ -785,11 +790,16 @@ also be given.
=over 4
-=item body ()
+=item body ( [ BODY ] )
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 I<BODY> is given, it can be a referenc to an aray or an array, then
+the body will be replaced. If a reference is passed, it is used directly
+and not copied, so any sunsequent changes to the array will change the
+contents of the body.
+
=item print_header ( [ FILEHANDLE ] )
=item print_body ( [ FILEHANDLE ] )
@@ -940,11 +950,11 @@ L<Mail::Address>
=head1 AUTHOR
-Graham Barr <gbarr@pobox.com>
+Graham Barr. Maintained by Mark Overmeer <mailtools@overmeer.net>
=head1 COPYRIGHT
-Copyright (c) 1995-7 Graham Barr. All rights reserved. This program is free
+Copyright (c) 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.