Solved

Displaying an email message.

Posted on 2004-04-14
4
169 Views
Last Modified: 2013-11-24
I am developing a WEB BASED email client using java mail API. I have given a text area to type the email. But when the email is displayed everthing comes in the same line. For example,

Dear aaaa
    bbbb
Regards cccc


Comes as

Dear aaaabbbbRegards cccc

What should I do for this?




0
Comment
Question by:arshadsam
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:Melih SARICA
ID: 10830695
In HTML line Feed Command is <br> but in text based files its #10 and #13 (Line feed + Return)

U must add <br> after end of each text line.  Or other way .. But a multiline Text box in ur HTML code and set a default value of ur Email Text Body

0
 

Author Comment

by:arshadsam
ID: 10831238
Do you mean a TextArea. If so there is no way to add <br> after end of each text line.

The value of the textarea is simple taken as follows,
   request.getParameter("textarea_name");


Or is there are a seperate multiline textbox in html?

Thanks
Arshad.
0
 
LVL 19

Accepted Solution

by:
Melih SARICA earned 50 total points
ID: 10831288
there 2 ways..

1.  Using a textbox in ur Page. and setting the mail body as the value of the Textbox.. this is easier..


2.  If u can get the mail body line by line .. add <br> after each line of the message body


Now. send the code of writing ur mail body in ur page..

&#305; guess u use something like  <% repsonse.write(mailbody) %>  is it true ?
0
 

Author Comment

by:arshadsam
ID: 10831450
I appended <br> when reading the mail line by line.

thisLine = reader.readLine();
                System.out.println("Line="+thisLine);
                while ((thisLine != null) && (!thisLine.trim().equals("null")))
                {
                    sbMsg.append(thisLine+"<br>");
                    thisLine = reader.readLine();
                }

Thanks

Arshad

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now