home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / sends406.zip / userexit < prev   
Text File  |  1998-12-22  |  1KB  |  34 lines

  1. #!/usr/local/bin/perl
  2.  
  3. $mailprogramm = "/usr/lib/sendmail -t > /dev/null";
  4. #$mailprogramm = "sendmail -t > nul";
  5. if ($ARGV[0] == "-1") {
  6.    if (open(MAIL, "|".$mailprogramm)) {
  7.       print MAIL "To: ", $ARGV[1], "\n";
  8.       print MAIL "From: SendSMS\n";
  9.       print MAIL "Subject: Message not delivered\n\n";
  10.       print MAIL "Your follwing message to ", $ARGV[2], " couldn't be delivered.\n\n";
  11.       print MAIL $ARGV[3], "\n";
  12.       close(MAIL);
  13.    }
  14. } elsif ($ARGV[0] == "1") {
  15.    if (open(MAIL, "|".$mailprogramm)) {
  16.       print MAIL "To: ", $ARGV[1], "\n";
  17.       print MAIL "From: SendSMS\n";
  18.       print MAIL "Subject: Message sent successfully\n\n";
  19.       print MAIL "Your following message to ", $ARGV[2], " was sent successfully.\n\n";
  20.       print MAIL $ARGV[3], "\n";
  21.       close(MAIL);
  22.    }
  23. } elsif ($ARGV[0] == "2") {
  24.    if (open(MAIL, "|".$mailprogramm)) {
  25.       print MAIL "To: ", $ARGV[2], "\n";
  26.       print MAIL "From: ", SendSMS, "\n";
  27.       print MAIL "Subject: Message received\n\n";
  28.       print MAIL "The following message from ", $ARGV[1], " was received.\n\n";
  29.       print MAIL $ARGV[3], "\n";
  30.       close(MAIL);
  31.    }
  32. }
  33. exit;
  34.