diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-08-17 13:47:53 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-08-17 13:47:53 +0000 |
commit | 686337f3173d259f9dc05f9d6c19a8c95e2cb00b (patch) | |
tree | 9e575920398a0d340a8fedabe030e312d87889d6 /lib/Net/SMTP.pm | |
parent | 1cbb078197bd3e77d2e55e7444405d31766c0c3b (diff) | |
download | perl-686337f3173d259f9dc05f9d6c19a8c95e2cb00b.tar.gz |
Upgrade to libnet 1.0704.
p4raw-id: //depot/perl@11709
Diffstat (limited to 'lib/Net/SMTP.pm')
-rw-r--r-- | lib/Net/SMTP.pm | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/lib/Net/SMTP.pm b/lib/Net/SMTP.pm index 8202d4871e..a2f2d2ee4a 100644 --- a/lib/Net/SMTP.pm +++ b/lib/Net/SMTP.pm @@ -16,7 +16,7 @@ use IO::Socket; use Net::Cmd; use Net::Config; -$VERSION = "2.15"; # $Id$ +$VERSION = "2.16"; # $Id: //depot/libnet/Net/SMTP.pm#16 $ @ISA = qw(Net::Cmd IO::Socket::INET); @@ -109,7 +109,7 @@ sub hello my $h = ${*$me}{'net_smtp_esmtp'} = {}; my $ln; foreach $ln (@msg) { - $h->{$1} = $2 + $h->{uc $1} = $2 if $ln =~ /(\S+)\b[ \t]*([^\n]*)/; } } @@ -308,7 +308,11 @@ sub recipient return $skip_bad ? @ok : 1; } -sub to { shift->recipient(@_) } +BEGIN { + *to = \&recipient; + *cc = \&recipient; + *bcc = \&recipient; +} sub data { @@ -384,7 +388,7 @@ Net::SMTP - Simple Mail Transfer Protocol Client =head1 SYNOPSIS use Net::SMTP; - + # Constructors $smtp = Net::SMTP->new('mailhost'); $smtp = Net::SMTP->new('mailhost', Timeout => 60); @@ -406,9 +410,9 @@ The Net::SMTP class is a subclass of Net::Cmd and IO::Socket::INET. This example prints the mail domain name of the SMTP server known as mailhost: #!/usr/local/bin/perl -w - + use Net::SMTP; - + $smtp = Net::SMTP->new('mailhost'); print $smtp->domain,"\n"; $smtp->quit; @@ -417,20 +421,20 @@ This example sends a small message to the postmaster at the SMTP server known as mailhost: #!/usr/local/bin/perl -w - + use Net::SMTP; - + $smtp = Net::SMTP->new('mailhost'); - + $smtp->mail($ENV{USER}); $smtp->to('postmaster'); - + $smtp->data(); $smtp->datasend("To: postmaster\n"); $smtp->datasend("\n"); $smtp->datasend("A simple test message\n"); $smtp->dataend(); - + $smtp->quit; =head1 CONSTRUCTOR @@ -467,6 +471,8 @@ Example: Debug => 1, ); +=back + =head1 METHODS Unless otherwise stated all methods return either a I<true> or I<false> @@ -544,9 +550,17 @@ If C<SkipBad> is true the C<recipient> will not return an error when a bad address is encountered and it will return an array of addresses that did succeed. + $smtp->recipient($recipient1,$recipient2); # Good + $smtp->recipient($recipient1,$recipient2, { SkipBad => 1 }); # Good + $smtp->recipient("$recipient,$recipient2"); # BAD + =item to ( ADDRESS [, ADDRESS [...]] ) -A synonym for C<recipient>. +=item cc ( ADDRESS [, ADDRESS [...]] ) + +=item bcc ( ADDRESS [, ADDRESS [...]] ) + +Synonyms for C<recipient>. =item data ( [ DATA ] ) @@ -593,4 +607,8 @@ Copyright (c) 1995-1997 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. +=for html <hr> + +I<$Id: //depot/libnet/Net/SMTP.pm#16 $> + =cut |