I've been trying to work out this very simple thing for hours now and I wonder if you can help.
My form submits the value of textarea, then takes the value and emails it in a plaintext email. Problem is the no matter what I do, I cannot get the line breaks in the email.
[CODE=php]
$msg_text = $_GET['msg_text'];
$email = "me@gmail.c om";
$subject = "My Subject";
$headers = 'From: me@me.com' . "\r\n" .
'Reply-To: me@me.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email,$su bject,$msg_text ,$headers);
echo "done";
[/CODE]
The form looks like this:[code=html]
<form action="FILE_NA ME" method="GET">
<textarea name="msg_txt" cols="50" rows="50"></textarea>
<input type="submit" value="go">
</form>[/code]
Something like nl2br is not an option because I don't want html output and I simply can't figure out why the line breaks are being taken out of this string.
Any help would be greatly appreciated!
My form submits the value of textarea, then takes the value and emails it in a plaintext email. Problem is the no matter what I do, I cannot get the line breaks in the email.
[CODE=php]
$msg_text = $_GET['msg_text'];
$email = "me@gmail.c om";
$subject = "My Subject";
$headers = 'From: me@me.com' . "\r\n" .
'Reply-To: me@me.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email,$su bject,$msg_text ,$headers);
echo "done";
[/CODE]
The form looks like this:[code=html]
<form action="FILE_NA ME" method="GET">
<textarea name="msg_txt" cols="50" rows="50"></textarea>
<input type="submit" value="go">
</form>[/code]
Something like nl2br is not an option because I don't want html output and I simply can't figure out why the line breaks are being taken out of this string.
Any help would be greatly appreciated!
Comment