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

Размер файла: 1.46Kb
<?
#####################################################################
#  Copyright (c) 2002 Pau Oliva Fora <[email protected]>               #
#  Licensed under the GNU GPL. For full terms see the file COPYING. #
##################################################################### 
require("config.php");
wmlheader();
wmlmeta();

// try to "authenticate" the user with imap: if he's not a valid imap user we don't let him send e-mails
$mbox = imap_open ("\{$IMAPSERVER:143}$F", "$U", "$P") or die ("can't connect: " . imap_last_error());
imap_close($mbox);

$headers = "From: <$From>\n";
$headers .= "X-Sender: <$U@$DOMAIN>\n";
$headers .= "X-Originating-IP: [$REMOTE_ADDR]\n";
$headers .= "X-Mailer: pofHQ wapMAIL $VERSION\n";

$Body = "$Body

--
This e-mail was sent using pofHQ wapMAIL $VERSION
from a $HTTP_USER_AGENT browser.
";


if (!preg_match('/^[A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{2,4}$/', $To )) die ("ERROR"); 

mail($To, $Subject, $Body, $headers);

echo "<card><p>$S_SENDOK $To<br/><br/>";

echo "<anchor title=\"$S_SUBMIT\">$S_SENDOTHER
<go href=\"compose.php\" method=\"post\">
<postfield name=\"F\" value=\"$F\"/>
<postfield name=\"U\" value=\"$U\"/>
<postfield name=\"P\" value=\"$P\"/>
</go></anchor><br/>";

echo "<anchor title=\"$S_SUBMIT\">$S_RETURN
<go href=\"index.php\" method=\"post\">
<postfield name=\"F\" value=\"$F\"/>
<postfield name=\"U\" value=\"$U\"/>
<postfield name=\"P\" value=\"$P\"/>
</go></anchor><br/>";
echo "</p>";

wmlfooter();
?>