views:

15

answers:

1

Hi,

In my cakephp website i have a controller which handles a simple contact form. But i have a problem! If in the contact_controller.php code i use:

$this->Email->send($this->data['Contact']['message']);

i receive the email in my mail box with linebreaks like the user wrote the message. But if i use:

$this->Email->send();

and create an html template to get the variables that i want to receive in mail, i will receive the same with no linebreaks.

How i can fix that?

A: 

Which one do you want? In the first case you send a plain text email, so you will have your line breaks in place. In the second place you send HTML e-mail, where line breaks are in place, but simply ignored.

So either keep sending mails plain text or use nl2br() function on the body for html output.

sibidiba
The function nl2br() works great! Thanks
alopes