Thickbox($_POST) Posting html data from textarea is removing newline character when read at server.

I have a thickbox window from where I can send email. (HTML email)
My email messages/body are assigned to a textarea in the thickbox using javascript.
When I submit the thickbox form It should send an email with mail-body mentioned in textarea.
Everything goes fine but the mailbody has NO linebreaks or newline characters.

I tried all these at the end of each line in text area, but nothing worked.

How to send this HTML email body with linebreaks ?

//Assigning mail content to text area.
getDocumentElementById('mail-message').value = '
Dear Sir,\r\n\
  This is in accordance with ....\r\n\
blah blah blah...................\r\n\
Thanking You \r\n\
- whoever\r\n\


In PHP (ServerCode)
$_POST['mail-message'] contains text without newline or line breaks.
$_POST['mail-message'] =>>> 'Dear Sir, This is in accordance with ...
blah blah blah...................Thanking You - whoever';

My email format is HTML email. (adding "<br/>" at the line end also had same results.)

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hi, I'm not sure that i understood your problem but maybe you could try with html, change \r\n\ with <br />. I has worked for me before.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
try <br> withot the /
BToTheAToTheBABAAuthor Commented:
declaring mail as html mail (not text mail)
and  worked
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.