I have an intranet set up at work using Apache, Mysql and php.
The fixed IP address is 192.2.107.124 and all users can browse to this site.
I have a form which gets this error on sending:
Parse error: parse error, unexpected ';' in C:\Program Files\xampp\htdocs\contact
.php on line 87
The php code is at the end of this post showing line 87.
I have a php.ini setting smtp as port 25 and ip address 192.2.107.26 which is our firms pop3 mail server.
Not really sure what the smtp server name should be and so tried to override using the ini_set() which is something else I am unsure of. What do I do to send forms as an email? I am really lost on this!
PHP CODE:
Below is a copy of the message you submitted:
--------------------------
----------
----------
----
Subject: $thesubject
Query:
$themessage
--------------------------
----------
----------
----
Thank you";
// email variable not set - load $valid_ref1 page
if (!isset($_POST['email']))
{
echo "<script language=\"JavaScript\"><!
--\n ";
echo "top.location.href = \"$valid_ref1\"; \n// --></script>";
exit;
}
$ref_page=$_SERVER["HTTP_R
EFERER"];
$valid_referrer=0;
if($ref_page==$valid_ref1)
$valid_referrer=1;
elseif($ref_page==$valid_r
ef2) $valid_referrer=1;
if(!$valid_referrer)
{
echo "<script language=\"JavaScript\"><!
--\n alert(\"$error_msg\");\n";
echo "top.location.href = \"$valid_ref1\"; \n// --></script>";
exit;
}
$themessage = "name: $name \nQuery: $themessage";
mail("$replyemail",
"$thesubject",
"$themessage",
"From: $email\nReply-To: $email");
mail("$email",
"Receipt: $thesubject",
"$replymessage",
ini_set("SMTP", "192.2.107.124");
ini_set("smtp_port", "25");
"From: $replyemail\nReply-To: $replyemail");
echo $success_sent_msg;
/*
PHP Form Mailer - phpFormMailer (easy to use and more secure than many cgi form mailers)
FREE from:
www.TheDemoSite.co.uk */
?>
END OF PHP
I get this error with ini_set removed.
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\xampp\htdocs\contact
.php on line 83
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\xampp\htdocs\contact
.php on line 87