git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 31, 2006, 22:55 UTC
Message-ID
<Pine.LNX.4.63.0606010054420.3617@wbgn013.biozentrum.uni-wuerzburg.de>

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>
---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 0e368ff..ed1d89b 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -21,7 +21,6 @@ use warnings;
 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 @@ X-Mailer: git-send-email $gitversion
 		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;
-- 
1.3.3.gc46d3-dirty
Message 1 of 1 in “send-email: only 'require' instead of 'use' Net::SMTP”
  1. send-email: only 'require' instead of 'use' Net::SMTPJohannes Schindelin, May 31, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.