home *** CD-ROM | disk | FTP | other *** search
/ Complete Internet Archive / Complete Internet Archive.iso / Web Boards / WebForum_tar(2).Z / WebForum_tar(2) / WebForum / src / SMail.pl < prev    next >
Encoding:
Text File  |  1995-01-21  |  1.2 KB  |  38 lines

  1.  
  2. require "ABSWFBIN/LIBWEBFORUM.PL";
  3.  
  4. while (<>) {
  5.   /^([^=]+)=(.+)\n/;
  6.   $arg=&WFDecodeDatum($1);
  7.   $value=&WFDecodeDatum($2);
  8.   $db{"$arg"}=$value;
  9. }
  10.  
  11. ;# the following no longer need to be protected
  12. $db{"body"} =~ s/&\;/&/g;
  13. $db{"body"} =~ s/<\;/</g;
  14. $db{"body"} =~ s/>\;/>/g;
  15.  
  16. open(F,">MAILQUEUE/$db{to}$$");
  17. print F "To: $db{to}\n";
  18. if ($db{"xref"} ne "") {print F "Subject: Re: $db{subject}\n";}
  19. else {print F "Subject: $db{subject}\n";}
  20. print F "WebForum-Gateway-HEADERS:\n";
  21. print F "WebForum-Sender: ($db{username}) <$db{email}>\n";
  22. print F "WebForum-Sender-URL: $db{hurl}\n";
  23. print F "WebForum-Reference: URLWFCOMPLETE\n";
  24. print F "WebForum-In-Reply-To: $db{xref}\n";
  25. print F "NOTE: Send mail to <$db{email}> to reply to originator of message.\n\n";
  26. print F "$db{body}";
  27. close(F);
  28.  
  29. # if you have a sendmail program that is not blocked by
  30. # your reading mail, then you might want to put in a
  31. # call to it here, such as that below. If, however, your
  32. # sendmail blocks, then you should queue outgoing mail,
  33. # and have a crontab program that periodically sends out
  34. # the mail. For an example, see the periodmail.pl program
  35. # in this directory
  36. ;#system("SENDMAIL MAILQUEUE/$db{to}$$ >/dev/null");
  37. ;#unlink("MAILQUEUE/$db{to}$$");
  38.