- Timestamp:
- 11/12/04 16:57:59 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r66 r68 15 15 use Exporter; 16 16 use Net::SMTP; 17 use POSIX; 17 18 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); 18 19 19 20 $VERSION = 1.0; 20 21 @ISA = qw(Exporter); 21 @EXPORT_OK = qw(&connectDB &checkDBSanity &allocateBlock );22 @EXPORT_OK = qw(&connectDB &checkDBSanity &allocateBlock &mailNotify); 22 23 23 24 @EXPORT = (); # Export nothing by default. 24 %EXPORT_TAGS = ( ALL => [qw( &connectDB &checkDBSanity &allocateBlock )]25 %EXPORT_TAGS = ( ALL => [qw( &connectDB &checkDBSanity &allocateBlock &mailNotify)] 25 26 ); 26 27 … … 78 79 sub mailNotify ($$$) { 79 80 my ($recip,$subj,$message) = @_; 80 my $mailer = new Net::SMTP "smtp.example.com";81 my $mailer = Net::SMTP->new("smtp.example.com", Debug => 1); 81 82 82 83 $mailer->mail('ipdb@example.com'); 83 84 $mailer->to($recip); 84 $mailer->data("X-Mailer: IPDB Notify v$IPDB::Version\n", 85 "Date: ".strftime("%a, %d %b %Y %H:%M:%S %z\n", localtime)."\n", 86 "Organization: Example Corp.", 87 "From: \"IP Database\" <ipdb\@example.com>\n", 88 "Subject: $subj\n", 89 "\n", 90 "$message\n"); 85 $mailer->data( 86 "X-Mailer: IPDB Notify v".sprintf("%.1d",$IPDB::VERSION)."\n", 87 "Date: ".strftime("%a, %d %b %Y %H:%M:%S %z",localtime)."\n", 88 "Organization: Example Corp.\n", 89 "From: \"IP Database\" <ipdb\@example.com>\n", 90 "Subject: {IPDB} $subj\n", 91 "X-Test: test\n", 92 "\n$message\n" 93 ); 91 94 $mailer->quit; 92 95 }
Note:
See TracChangeset
for help on using the changeset viewer.