Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Displaying an email message.

Posted on 2004-04-14
4
Medium Priority
?
213 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 150 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Starting up a Project

886 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