Просмотр файла mail/mail/sendmail.php

Размер файла: 1.46Kb
  1. <?
  2. #####################################################################
  3. # Copyright (c) 2002 Pau Oliva Fora <pau@eSlack.org> #
  4. # Licensed under the GNU GPL. For full terms see the file COPYING. #
  5. #####################################################################
  6. require("config.php");
  7. wmlheader();
  8. wmlmeta();
  9.  
  10. // try to "authenticate" the user with imap: if he's not a valid imap user we don't let him send e-mails
  11. $mbox = imap_open ("\{$IMAPSERVER:143}$F", "$U", "$P") or die ("can't connect: " . imap_last_error());
  12. imap_close($mbox);
  13.  
  14. $headers = "From: <$From>\n";
  15. $headers .= "X-Sender: <$U@$DOMAIN>\n";
  16. $headers .= "X-Originating-IP: [$REMOTE_ADDR]\n";
  17. $headers .= "X-Mailer: pofHQ wapMAIL $VERSION\n";
  18.  
  19. $Body = "$Body
  20.  
  21. --
  22. This e-mail was sent using pofHQ wapMAIL $VERSION
  23. from a $HTTP_USER_AGENT browser.
  24. ";
  25.  
  26.  
  27. if (!preg_match('/^[A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{2,4}$/', $To )) die ("ERROR");
  28.  
  29. mail($To, $Subject, $Body, $headers);
  30.  
  31. echo "<card><p>$S_SENDOK $To<br/><br/>";
  32.  
  33. echo "<anchor title=\"$S_SUBMIT\">$S_SENDOTHER
  34. <go href=\"compose.php\" method=\"post\">
  35. <postfield name=\"F\" value=\"$F\"/>
  36. <postfield name=\"U\" value=\"$U\"/>
  37. <postfield name=\"P\" value=\"$P\"/>
  38. </go></anchor><br/>";
  39.  
  40. echo "<anchor title=\"$S_SUBMIT\">$S_RETURN
  41. <go href=\"index.php\" method=\"post\">
  42. <postfield name=\"F\" value=\"$F\"/>
  43. <postfield name=\"U\" value=\"$U\"/>
  44. <postfield name=\"P\" value=\"$P\"/>
  45. </go></anchor><br/>";
  46. echo "</p>";
  47.  
  48. wmlfooter();
  49. ?>