@matheusbsbs / matheus-bagliano / commits / 87840620fd
Fork 0

send-email: only 'require' instead of 'use' Net::SMTP

This was proposed by Eric Wong and fixes the test. (Of course, git-send-email does not work, if there is no Net::SMTP here, but it will say what is wrong when you actually try to use send-email.) Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Jun 1, 2006 at 00:55 UTC 87840620fd77e39a0df91dc8b8db6cfdb5e4845a
1 file changed +1 -1
git-send-email.perl
+1 -1
@@ -21,7 +21,6 @@ use warnings;
21 use Term::ReadLine;
22 use Getopt::Long;
23 use Data::Dumper;
24 -use Net::SMTP;
24
25 # most mail servers generate the Date: header, but not all...
26 $ENV{LC_ALL} = 'C';
@@ -394,6 +393,7 @@ X-Mailer: git-send-email $gitversion
393 print $sm "$header\n$message";
394 close $sm or die $?;
395 } else {
396 + require Net::SMTP;
397 $smtp ||= Net::SMTP->new( $smtp_server );
398 $smtp->mail( $from ) or die $smtp->message;
399 $smtp->to( @recipients ) or die $smtp->message;