Changeset 10790
- Timestamp:
- 2005-10-28T16:16:42+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/cgi-bin/gliserver
r10727 r10790 10 10 my $authentication_enabled = 1; 11 11 my $debugging_enabled = 0; 12 13 my $mail_enabled = 1; 14 my $mail_to_address = "user\@server"; # Set this appropriately 15 my $mail_from_address = "user\@server"; # Set this appropriately 16 my $mail_smtp_server = "smtp.server"; # Set this appropriately 12 17 13 18 … … 642 647 $gsdl_cgi->generate_error("Perl failed: $perl_command\n--\nExit status: " . ($perl_status / 256)); 643 648 } 649 elsif ($mail_enabled) { 650 if ($script eq "buildcol.pl") { 651 &send_mail("Remote Greenstone building event", "Build of collection '$collection' complete."); 652 } 653 } 644 654 } 645 655 … … 747 757 748 758 759 sub send_mail 760 { 761 my $mail_subject = shift(@_); 762 my $mail_content = shift(@_); 763 764 my $sendmail_command = "perl -S sendmail.pl"; 765 $sendmail_command .= " -to \"" . $mail_to_address . "\""; 766 $sendmail_command .= " -from \"" . $mail_from_address . "\""; 767 $sendmail_command .= " -smtp \"" . $mail_smtp_server . "\""; 768 $sendmail_command .= " -subject \"" . $mail_subject . "\""; 769 770 if (!open(POUT, "| $sendmail_command")) { 771 $gsdl_cgi->generate_error("Unable to execute command: $sendmail_command"); 772 } 773 print POUT $mail_content . "\n"; 774 close(POUT); 775 } 776 777 749 778 &main();
Note:
See TracChangeset
for help on using the changeset viewer.