Forum Moderators: coopster
I've got a strange wee problem, I'm using mail(); to send an email. Basically, contrary to my advice, all the user's information goes into one textarea with default text to prompt the user to input the necessary information.
this is the form I'm using, generated by PHP:
***************CODE**********************
echo("<form id=\"mailform\" method=\"POST\" >\n<p><textarea name=\"message\" cols=\"30\" rows=\"10\" class=\"boxes\" >");
echo("Name:\n");
echo("Email:\n");
echo("Tel:\n");
echo("Query:\n");
echo("*Please ensure your contact details are correct*\n");
echo("</textarea><input type=hidden name=\"recipient\" value=\"email@your.host.com\"><input type=\"submit\" value=\"Submit\" name=\"B1\" class=\"boxes\">" );
***************END OF CODE**********************
then I use my cleaner script to avoid injections and send the mail hence:
***************CODE**********************
$cleanMessage = cleanVar($_POST['message'],false,true,true);
mail("recipient@domain.com", "subject", $cleanMessage, "From: somebody@somedomain.com" );
***************END OF CODE**********************
the problem is that the email is arriving all on one line like this:
name:bob\r\nemail:dangerbob@bob.bob\r\ntel:jim\r\nquery:jones\r\n*please ensure your contact details are correct*\r\n
any ideas how I can preserve the line breaks?
thanks in advance