problems with line breaks in a "Input Text Field"
Hi all,
I've create an email form in flash that uses ac3 and php to send out an email when the users click on the submit button. However, the email I receive loses all line break information.
example:
user inputs:
hi
there
form
I will get an email that is 1 line only "hithereform"
Here is the ac3 code:
var email_data:String = "name=" + contactName_txt.text
+ "&email=" + contactEmail_txt.text
+ "&subject=" + "Web Form Message"
+ "&message=" + contactMessage_txt.text;
And the php code:
<?php
$contact_name = $_POST['name'];
$contact_email = $_POST['email'];
$contact_subject = $_POST['subject'];
$contact_message = $_POST['message'];
if( $contact_name == true )
{
$sender = $contact_email;
$receiver = "a@1234.com";
$client_ip = $_SERVER['REMOTE_ADDR'];
$email_body = "Name: $contact_name \nEmail: $sender \n\nSubject: $contact_subject \n\nMessage: \n\n$contact_message \n\nIP: $client_ip ";
$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
if( mail( $receiver, "$contact_subject", $email_body, $extra ) )
{
echo "success=yes";
}
else
{
echo "success=no";
}
}
?>
Can anyone tell me what I did wrong?
Thank you very much in advance