Wait a minute... look at the parameters you're sending to mail()! What is all that stuff?
Take a look at the manual:
http://www.php.net/function.mail
This is the function declaration/signature for mail()
bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]])
That means that mail() returns a boolean TRUE or FALSE to signify success in sending the message.
You're passing a lot of extra parameters to the function. Let's compare each parameter you pass to what the function actually expects.
Code:
You PHP
$to to // ok!
$subject subject // ok!
$mess message // ok!
$mess2 addl headers // NOT OK!
$mess3 addl params // NOT OK!
$mess4 // NOT OK!
$extra // NOT OK!
$contact // NOT OK!
$memnum // NOT OK!
$address // NOT OK!
$busname // NOT OK!
$telephone // NOT OK!
$postcode // NOT OK!
You're passing 8 more parameters to the function than it expects. Only ONE parameter is supposed to contain the entire message body, so you need to format your entire message as a single string before you send it to mail.
$msg = "this request for a copy of the Guid is from {$contact} (Membership No: {$memnum})\n";
$msg .= "Name of Business: {$busname}\n"; // see, i'm appending to $msg
$msg .= "Address: {$address} {$postcode}.\n"; // |
$msg .= "Telephone No: {$telephone}.\n"; // V
$ret = mail($to, $subject, $msg); // no extra headers or params necessary
if ($ret)
{
echo "Mail successfully sent.\n";
}
else
{
echo "Error sending message!\n";
}
Take care,
Nik
http://www.bigaction.org/