Hello,
I have this form.php code
<?php
if(isset($_POST['submit'])) {
$to = "davidraiben3@gmail.com";
$emailSubject = 'contactform';
$name = $_POST['name'];
$email_form = $_POST['email'];
$phone = $_POST['phone'];
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['phone'])
) {
echo "ישנה בעיה בטופס שמילאת";
}
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_form)) {
$error_message .= 'האי-מייל שהזנת לא תקין.<br />';
}
$email_message = "הפרטים של שולח הטופס.\
\
";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "שם: ".clean_string($name)."\
";
$email_message .= "אי-מייל: ".clean_string($email_form)."\
";
$email_message .= "טלפון: ".clean_string($phone)."\
";
if (preg_match("/http/i", "$name")) {echo "$CheckMessage"; exit();}
if (preg_match("/http/i", "$email_form")) {echo "CheckMessage"; exit();}
if (preg_match("/http/i", "$phone")) {echo "$CheckMessage";exit();}
$CheckMessage = "URL permitted";
$headers = 'From: '.$email_form."\\r\
";
'Reply-To: '.$email_form."\\r\
" .
'X-Mailer: PHP/' . phpversion();
mail($to,$email_form,$email_message,$headers);
}
/* Results rendered as HTML */
$theResults = <<<EOD
<html lang="he-IL">
<head><meta charset="utf-8">
<title>index.htm</title>:)
<meta http-equiv="refresh" content="10;URL=http://honmashkanta.com/">
<style type="text/css">
<!--
body {
background-color: #444; /* You can edit this CSS to match your website*/
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fec001;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}
-->
</style>
</head>
<body>
<div>
<div align="center">פרטייך נקלטו בהצלחה, ניצור קשר בהקדם</div>
</div>
</body>
</html>
EOD;
echo $theResults;
?>
when I try to send it it says:
Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in C:\Inetpub\vhosts\honmashkanta.com\httpdocs\form.php on line 44
פרטייך נקלטו בהצלחה, ניצור קשר בהקדם
what seems to be the problem the code has worked before