این کار رو کردم ولی درست نشد، این هم کدش :
<?php
session_start();
?>
<meta charset="utf8">
<title>Sending E-Mail | ارسال رایانامه</title>
<?php
if($_POST['captcha'] == $_SESSION['captcha']) {
$nameFamily=$_POST['nameFamily'];
$mail=$_POST['mail'];
$phone=$_POST['phone'];
$text=$_POST['text'];
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From:".$mail."; <".$mail.">\r\nReply-To: ".$mail.";";
$text="<div style='font:12px Segoe UI'>Name & Family : ".$nameFamily."<br>
E-Mail : ".$mail."<br>
Phone : ".$phone."<br>
Explanation : ".$text."</div>";
$to="ABZiko@chmail.ir";
$subject="Request from ".$nameFamily;
if(mail($to,$subject,$text,$headers)) {
echo "<div style='font:12px Segoe UI'>Your Message Sent !</div>";}
else{
echo "<div style='font:12px Segoe UI'>Your Message Didn't Sent !</div>"; }
}
else{
echo "<div style='font:12px Segoe UI'>Your Security Code is Entered Wrongly !</div>";
}
?>
البته بنده از Captcha هم استفاده می کنم که این هم کدش :
<?php
session_start();
$code=rand(100000,999999);
$_SESSION["captcha"]=$code;
$im = imagecreate(100, 50);
$bg = imagecolorallocate($im, 22, 86, 165);
$fg = imagecolorallocate($im, 255, 255, 255);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
imageline($im, rand(0,100), rand(0,50), rand(0,100), rand(0,50), $fg);
$x=mt_rand(0,30);
$y=mt_rand(30,35);
$textAngle=mt_rand(-15,15);
imagettftext($im, 20, $textAngle, $x, $y, $fg, "BRUSHSCI.TTF", $code);
header("Cache-Control: no-cache, must-revalidate");
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>