Forums

Add breaks in html email on text area

alinden 14 Jan, 2014
Hello,

When sending form data through mail, the data from a text area is shown as one block of text. So without any breaks, etc. Is there a way to prevent this? Or is it possible to just send a text email (non-html)?

Kind regards
GreyHead 14 Jan, 2014
Hi alinden,

In CFv4 you can set the email to plain text in the action configuration. I'm not sure if this will do what you want though.

You can also replace line-breaks with <br /> tags using a Custom Code action like this:[code]<?php
$form->data['input_name'] = nl2br($form->data['input_name');
?>[/code]
Bob
alinden 16 Jan, 2014
Works fine, Thanks!
This topic is locked and no more replies can be posted.