about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2002-02-22 14:57:42 +0000
committerGraham Barr <gbarr@pobox.com>2002-02-22 14:57:42 +0000
commit8a099f7243940f8e41a6893e2f635e6e75428a3f (patch)
tree37f1e6030ba2ffdeddf1015fe99b11cf86727b0e
parent48f64ce5d1edf55a47f107dc6453eb39f646e7c0 (diff)
downloadperl-libnet-8a099f7243940f8e41a6893e2f635e6e75428a3f.tar.gz
Net::SMTP
- Support binding to a local port/address

-rw-r--r--Net/SMTP.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Net/SMTP.pm b/Net/SMTP.pm
index bae5835..e5d2d4c 100644
--- a/Net/SMTP.pm
+++ b/Net/SMTP.pm
@@ -16,7 +16,7 @@ use IO::Socket;
 use Net::Cmd;
 use Net::Config;
 
-$VERSION = "2.19"; # $Id: //depot/libnet/Net/SMTP.pm#20 $
+$VERSION = "2.20"; # $Id: //depot/libnet/Net/SMTP.pm#21 $
 
 @ISA = qw(Net::Cmd IO::Socket::INET);
 
@@ -34,6 +34,8 @@ sub new
   {
    $obj = $type->SUPER::new(PeerAddr => ($host = $h),
                             PeerPort => $arg{Port} || 'smtp(25)',
+                            LocalAddr => $arg{LocalAddr},
+                            LocalPort => $arg{LocalPort},
                             Proto    => 'tcp',
                             Timeout  => defined $arg{Timeout}
                                                 ? $arg{Timeout}
@@ -477,6 +479,9 @@ B<Hello> - SMTP requires that you identify yourself. This option
 specifies a string to pass as your mail domain. If not
 given a guess will be taken.
 
+B<LocalAddr> and B<LocalPort> - These parameters are passed directly
+to IO::Socket to allow binding the socket to a local port.
+
 B<Timeout> - Maximum time, in seconds, to wait for a response from the
 SMTP server (default: 120)
 
@@ -636,6 +641,6 @@ it under the same terms as Perl itself.
 
 =for html <hr>
 
-I<$Id: //depot/libnet/Net/SMTP.pm#20 $>
+I<$Id: //depot/libnet/Net/SMTP.pm#21 $>
 
 =cut