I'm fairly new to php and I am trying to use it to collect data from a form I have on my website, then post the content of the forms to my email address, but my send.php script keeps giving me errors.
This is what I have:
$company=$_POST['company'];
$contact=$_POST['contact_person'];
$position=$_POST['position'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$finance=$_POST['finance'];
$items=$_POST['items'];
$kind=$_POST['kind'];
$date=$_POST['date'];
$body="company name:". $company . "<br />Contact person:".$contact."<br />position:"
.$position."<br />phone:".$phone."<br />address:".$address."<br />finance:".$finance."<br />items:"
.$items."<br />date:".$date;
$to = "contact@sigmastrat.com"; //your email address
$message = $body ."<br/><hr/><br/>".$content;
$from = $_POST['email'];
$headers = "From:" . $from;
mail($to, $message, $headers);
echo "Mail Sent.";
I keep getting errors on lines 19 and 22:
$message = $body ."<br/><hr/><br/>".$content; // L19
mail($to, $message, $headers); // L22
What am I doing wrong?
The error msgs are:
Notice: Undefined variable: content in C:\wamp\www\CPIBootstrap\send_d.php on line 19
And:
Warning: 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:\wamp\www\CPIBootstrap\send_d.php on line 22