<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail("your_email@gmail.com", $subject,
$message, "From:" . $email);
echo "متشکریم، پیام شما ارسال شد.";
}
else
//if "email" is not filled out, display the form
{
echo "<div align=\"center\">
<form method='post' action='email.php'>
ایمیل شما :
<br /><br /><input name='email' type='text' style=\"text-align:left; direction:ltr;\"><br /><br />
موضوع پیام :
<br /><br /><input name='subject' type='text' style=\"text-align:right; direction:rtl;\"><br /><br />
متن پیام
<br /><br />
<textarea name='message' rows='15' cols='40' style=\"text-align:right; direction:rtl;\">
</textarea><br />
<input type='submit'>
</form>
</div>";
}
?>
</body>
</html>