Solved

Displaying an email message.

Posted on 2004-04-14
4
174 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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…

919 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

16 Experts available now in Live!

Get 1:1 Help Now