Link to home
Start Free TrialLog in
Avatar of Cheryl Lander
Cheryl LanderFlag for United States of America

asked on

formatting of text area in php mail

Hi All,

We have a form text area field below, but when we process the code, the body of the email does not appear the way it was entered in the form.

It should appear with line breaks, but instead it appears as one line of text.

Should appear like :

Hi Client,

Thanks for the meeting today.

Regards.


But appears like

Hi Client, Thanks for the meeting today. Regards.

<textarea cols="45" rows="9" name="email_message_one">This message will go to the client.</textarea>

Open in new window


Header
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

Open in new window


if (!isset($_POST['email_message_one']))  $email_message_one = ''; else $email_message_one = $_POST['email_message_one'];

Open in new window


Email body
$email_message_one

Open in new window


Any help would be appreciated.
SOLUTION
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How are you entering it in the form?  If you press 'enter' while you are in a form, it will submit the form, not create a line break.
Avatar of Cheryl Lander

ASKER

We have tried just hitting enter for each line, also by hitting Shift + Enter.

Same results.

All text comes out as one line.

We have looked into the suggestion that Loganathan has provided but are having trouble implementing it.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial