close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Line Returns Missing from Received Email

Thread began 8/08/2009 12:25 pm by patch.work177889 | Last modified 9/17/2009 6:57 am by info72555 | 3360 views | 9 replies |

patch.work177889

Line Returns Missing from Received Email

I've set up a form for our club officers to email all active members using UE 3.0.6 & a MySQL record set. So far, everything seems to be working fine EXCEPT any returns entered into the form do not show up. I have all charsets to UTF-8. I've tried other charsets, but same problem. Of course, if I enter BR tags into the form, those will work.

I've noticed other threads discuss a solution by changing lines in the mail_PHP.php file:

$lineEnd = "\r\n";

and change it to:
$lineEnd = "\n";

It seems that this might address my issue, but before I start mucking about inside the WA files, I thought there might be a different solution. Attached is my php page with the email form & UE server behavior along with the UE files.

thanks,
rob welles

Attached Files
WA_UE_files.zip
Sign in to reply to this post

Eric Mittman

If you are apprehensive about altering the code in the file you can make a backup of the file first, then just make an update to the line. This should be a very simple update that needs to only be performed in one place. Please try this out and if you have any issues post back and let us know.

Sign in to reply to this post

Ray BorduinWebAssist

try using str_replace("\\n","<br>",$_POST['field']);

That should replace return key with BR tags so that they will show up in html and in the email.

Sign in to reply to this post
Did this help? Tips are appreciated...

patch.work177889

Ray,

Where would the code snippet be placed? Inside the body tab of UE?

Sign in to reply to this post

Ray BorduinWebAssist

Yes, wherever you are referring to a value that you want line breaks to appear as <br> tags. In this case that is in the body of the universal email.

Sign in to reply to this post
Did this help? Tips are appreciated...

patch.work177889

Ray,

I sure appreciate your help on this!! However, I'm not quite there yet... When I use the dynamic button (in the Edit Mode of the Body Tab) to select the form field, the following code gets inserted:

<?php echo((isset($_POST["body"]))?$_POST["body"]:"") ?>

I tried:

<?php echo(str_replace("\\n","<br>",$_POST['body'])); ?>

and

<?php echo((isset($_POST["body"]))?str_replace("\\n","<br>",$_POST['body']):"") ?>

In both cases, the text shows up but not any returns.

Any suggestions?

thanks,
rob

Sign in to reply to this post

Ray BorduinWebAssist

Sorry... my mistake... it should only have one backslash.... other than that both would probably work.

<?php echo(str_replace("\n","<br>",$_POST['body'])); ?>

Sign in to reply to this post
Did this help? Tips are appreciated...

patch.work177889

Ray - Thanks for the quick lesson in using str_replace! Everything is working perfectly!!

Sign in to reply to this post

info72555

Still confused

I don't know anything about programming and get easily frustrated. I have attempted to follow your instructions and assume I am making a really dumb mistake.

Where exactly do you place the String Replace line you mentioned? Do I still need to remove the "\r"? There are 2 lines with "\r\n" but you are suggesting to only change one?

I opened the WAUE file and assume I need to make a change to the following section:
//Start Mail Body
$MailBody = $MailBody . "";
foreach( $_POST as $pkey => $pval ) {
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . (str_replace("_"," ",$pkey).": ".($pval));
$MailBody = $MailBody . "\r\n";
}
$MailBody = $MailBody . "";
//End Mail Body

What do I do to get the line breaks in the output?

Please help.. I am about to lose my mind!!

Sign in to reply to this post

info72555

Found a fix!

I had previously purchased the Contact Form Solution Pack and I am now recycling a template. All the formatting is done in this template and style sheets can be applied as well.
Works great!

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...