Hi Guys, here are the particulars, and it's really weird.
The form has quite a few text feilds and text areas. I have done some more testing and have discovered that the problem ONLY occurs when 2 or more text feilds have commas in them.
It doesn't matter what combination, if 2 or more feilds have commas in them, the mail won't doesn't arrive. Take the commas out, leaving only one feild with a comma in it, and it arrives fine.
Text Areas are fine, add as many commas as you like.
I have outputted the content and headers to the page, everything is normal, including the recipient.
I also placed a small mail() script right under where the formmail should be sent as follows:
mail($recipient, $subject, $message, $headers); // Orig Send
mail('me@me.com','Report','OK'); // Debug Send
The debug works fine, but if you enter commas into 2 or more text feilds, and change 'OK' to $message, nothing is sent at all. Even though I can output all the variables on screen using echo in the script.
Here is the code that sets $message:
Code:
$message = "This is a multi-part message in MIME format.\n";
$message .= "\n--".$ob."\n";
$message .= "Content-Type: multipart/alternative;\n\tboundary=\"".$ib."\"\n\n";
$message .= "\n--".$ib."\n";
$message .= "Content-Type: text/html;\n\tcharset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: quoted-printable\n\n";
//Add normal header//////////////////////////////////////////////////////
$message .= "Below is the result of your feedback form. It was submitted by<br>";
$message .= "(<a href=\"\"mailto:" . $email . ">" . $email . "</a>) on " . $orderTime . "<br>";
$message .= "---------------------------------------------------------------------------<br><br>";
//////////////////////////////////////////////////////////////////////////////////////////////
$message .= $content."\n\n";
$message .= "\n--".$ib."--\n";
if ($attachment_name && !$attachment_sent) {
$message .= "\n--".$ob."\n";
$message .= "Content-Type: $attachment_type;\n\tname=\"".$attachment_name."\"\n";
$message .= "Content-Transfer-Encoding: base64\n";
$message .= "Content-Disposition: attachment;\n\tfilename=\"".$attachment_name."\"\n\n";
$message .= $attachment_chunk;
$message .= "\n\n";
$attachment_sent = 1;
}
$message .= "\n--".$ob."--\n";
mail($emed_recipient, $emed_subject, $message, $headers);
Like I said, the wierd part is, sending only fails when two or more feilds have commas in them. If only one feild has a comma, no problem.