שם השולח הוא חובה"; */ $mail_ok=false; } if ($_POST["mail_name"]==""){ /* echo "
כתובת האימייל הוא חובה
"; */ $mail_ok=false; } if ($mail_ok) //if the fields are filled, we attempt to send the mail { $to=$_POST["mail_to"]; //the E-mail to send the message to $subject=$_POST["mail_subject"]; //the subject of the mail $body=$_POST["mail_body"]."\n\n\n"; //the body of the mail (a text added to every mail body) $headers="From: ".$_POST["mail_from"]."\r\n"; //the headers of the mail if ($_POST["mail_name"]!="") //if the name field is filled $headers="From: ".$_POST["mail_name"]." <".$_POST["mail_from"].">\r\n"; //we add the name to the From header /* attempt to send the message */ $mail_ok=@mail($to,$subject,$body,$headers); //returns true if mail was sent successfully, if not then returns false if ($mail_ok) //if the mail was sent successfully { echo "

הקישור נשלח בהצלחה!

"; echo "שלח שוב"; } else { echo "
שליחת ההודעה נכשלה !!!
בדוק את כתובת האי-מייל
"; } } else { echo "
שם השולח והאימייל חובה
"; } ?>