Forums

Email text has no carriage returns

Thrushwood 20 Mar, 2009
I would appreciate any help with my problem which is..

..having set up a form with text box the emails received do not have carriage returns often making the text very difficult to read. I have tried different wrap commands but this makes no difference. I have read elsewhere on the forum that ChronoForms use unformatted HTML so will not pass carriage returns. If this is the case is there any other way of getting around the problem?
Max_admin 20 Mar, 2009
Hi Thrushwood,

try to switch the email type to "plain text" in the "Email properties" area ?

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 22 Mar, 2009
Thanks for the response but where can I find the "email properties" area?
For your information I am using ChronoForms V2.3.9 J1.0
Max_admin 23 Mar, 2009
then this is another scenario, try to put this code in the onsubmit before email :


<?php
$_POST['fieldname'] = nl2br($_POST['fieldname']);
?>


replace fieldname with the real textbox name!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 23 Mar, 2009
Hi Max,

Tried adding the code you suggested, replacing the field name, but still no carriage returns are present in the email.

Is there any thing else you can suggest?

Regards,

Paul S.
Max_admin 24 Mar, 2009
hi Paul,

try :
    <?php
    $_POST['fieldname'] = str_replace("\n", "<br>", $_POST['fieldname']);
    ?>


?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 24 Mar, 2009
Hi Max,

I've tried the new line of code and its the same problem.

Regards,

Paul
Max_admin 25 Mar, 2009
try this:

        <?php
        $_POST['fieldname'] = str_replace(array(chr(10), chr(13)), "<br>", $_POST['fieldname']);
        ?>
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 26 Mar, 2009
Hi Max,

Sorry but the new piece of code still hasn't cured the problem.

Regards,

Paul
Max_admin 26 Mar, 2009
Hi Paul,

ok, lets test something, add my code above to the onsubmit after email box and add before it "echo " so you can see the output, what do you get ?

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 26 Mar, 2009
Hi Max,

You are going to have to be patient with me here because I don't know php code so if I add the code, with echo in front where do I see the output? I have tried adding it to the 'On Submit code - after sending email' (your previous replies mentioned adding to the on submit before email) and then submitting a completed form which returns by email but is no different. At the moment other than adding the code you suggest the on submit code before and after fields are empty, just the html and email fields having the html code in them. I guess I am not doing something right - could you spell it out for me?

Thanks,

Paul
Max_admin 26 Mar, 2009
Hi Paul,

add the echo before the first $_POST word and leave a space between them!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 27 Mar, 2009
Hi Max,

Ok - added echo with space as mentioned, sent form and received email which is still the same. Where should I expect to see the output from the echo command?

Regards,

Paul
Max_admin 27 Mar, 2009
Hi Paul,

the output should appear just after the submit at your site, like a "thank you message", do you have a redirect URL ? if so then please remove it temporarily to see the message!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 30 Mar, 2009
Hi Max,

The image shows the output on submit.

Regards,

Paul
Max_admin 30 Mar, 2009
and what did you add to the textbox to get this result ? why its showing the line 3 times!! ?

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 30 Mar, 2009
Hi Max

I entered into the text box..

"Single line of text and 2 carriages returns"

..3 times.

The output showed it just as I entered it, the single line of text on 3 separate lines.
The email collapses it to a continuous line of text with just a space between each line.

regards,

Paul
Max_admin 30 Mar, 2009
cool, so it works fine after the form submit but not in the email ? do you have this code in the onsubmit "before" email or "after" email ? make it "before" please and let me know!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 31 Mar, 2009
OK Max, when I came to move the code from the submit after to submit before email I found that I had left one of the earlier pieces of code you suggested in there! Once that code had been replaced the echo output showed the entered text but without the error message that was outputted previously. However the email still came through with the text collapsed to one line. Does this mean it is likely to be a email/server/hosting issue?
Max_admin 31 Mar, 2009
No I don't think so, it may be a line of code which removed the HTML after we added it, lets try this, at your textbox, after each line, add <br> , what do you get in the email ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 01 Apr, 2009
Hi Max,

As you thought adding <br> to the form text does separate the lines in the email.

Regards,

Paul
Max_admin 01 Apr, 2009
This is really puzzling now, I thought it will not because the html tags are getting filtered, but it looks like no, and you are sure that the code we used before was in the "onsubmit BEFORE email" box ? if so then I need t check this myself, please send me a temporarily admin login through the PM

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 03 Apr, 2009
Hi Max,

Just checking you get my PM as requested.

Regards,

Paul
Max_admin 04 Apr, 2009
Hi Paul,

yes I got it, but was very busy with the new version, will check it today!

regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 06 Apr, 2009
I fixed it using the same code in the email template!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thrushwood 07 Apr, 2009
Hi Max,

Thanks very much for your help - and patience!

Best regards,

Paul
Muneo 13 Apr, 2009
What's the solution to this problem???
Could you help me? I have the textarea to get address, so it's interesting that I receive the email with newline...
Muneo 14 Apr, 2009
Thanks, perfect!!!
This topic is locked and no more replies can be posted.