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.
\r\n\
\n\
<br/>

How to send this HTML email body with linebreaks ?
Initializing
---------------
$(document).ready(function(){

//Assigning mail content to text area.
getDocumentElementById('mail-message').value = '
Dear Sir,\r\n\
\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.
i.e.
$_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

BToTheAToTheBABAAsked:
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.

tech_cyclopsCommented:
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.
0

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
Ante0Commented:
try <br> withot the /
0
BToTheAToTheBABAAuthor Commented:
declaring mail as html mail (not text mail)
and  worked
0
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
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.