From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Date: Wed, 31 May 2006 22:55:47 +0000 (+0200)
Subject: send-email: only 'require' instead of 'use' Net::SMTP
X-Git-Tag: v1.4.0-rc1~22
X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/87840620fd77e39a0df91dc8b8db6cfdb5e4845a

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>
---

diff --git a/git-send-email.perl b/git-send-email.perl
index 0e368fff0c..ed1d89b3f7 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -21,7 +21,6 @@
 use Term::ReadLine;
 use Getopt::Long;
 use Data::Dumper;
-use Net::SMTP;
 
 # most mail servers generate the Date: header, but not all...
 $ENV{LC_ALL} = 'C';
@@ -394,6 +393,7 @@ sub send_message
 		print $sm "$header\n$message";
 		close $sm or die $?;
 	} else {
+		require Net::SMTP;
 		$smtp ||= Net::SMTP->new( $smtp_server );
 		$smtp->mail( $from ) or die $smtp->message;
 		$smtp->to( @recipients ) or die $smtp->message;