<?php
/**
* @author: Sallar Kaboli
* @copyright: (C) 2006 Sallar Kaboli
* @website: www.rootcoders.com
* @date: 12/25/05
*/
error_reporting(E_ALL ^ E_NOTICE);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mailin'</title>
</head>
<body>
<?php
if($_REQUEST[action] == "send"){
$mail = $_REQUEST[mail];
$name = $_REQUEST[name];
$to = $mail;
$from = "[email protected]"; //Maileto Inja Benvis
$subject = "Testing...";
$headers .= "To: $name <".$to.">\n";
$headers .= "From: Nastaran <".$from.">\n"; //esmo avaz kon
$headers .= "Subject: $subject\n";
$headers .= "X-Sender: PHP 5.1\n";
$body = $_REQUEST[message];
$body = str_replace("{name}", $name, $body);
$body = str_replace("{mail}", $mail, $body);
if(@mail($to, $subject, $body, $headers)){
echo"<font color='green'>Mail Successfully Sent to $to</font><br>\n";
}
else{
echo"<font color='red'>Cannot Send Mail Message to : $to</font><br>\n";
}
}
?>
<form method="post" name="mailin" action="<?=$_SERVER[PHP_SELF]?>" />
Name: <input type="text" name="name" size="30" /><br />
Mail: <input type="text" name="mail" size="30" /><br />
Message:<br />
<textarea name="message" style="width: 400px; height: 250px;" />
<?php echo"Hello {name},\nIt is just to let you know That our Mail script works fine!\n\nBye!"; ?>
</textarea> <br />
Use this variables: {name} {mail}<br />
<input type="submit" value="Send Test Email" />
<input type="hidden" name="action" value="send" />
</form>
<br /><br /><br />
<font size="2;" color="#cccccc" face="tahoma">© 2006 Sallar Kaboli</font>
</body>
</html>