Author
Generate Email body
Sahana Hegde
Ranch Hand
Joined: Jan 27, 2008
Posts: 67
Hello, How can I generate the email body to be sent with some styles. For now I am just creating a string and appending information to the string.I am appending a \r where I need a gap. The email is generated something like this. ---------------------- Name : sah Forum : javaranch url : www.url.com ---------------------- How can I make it look better? Thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35243
posted Aug 05, 2008 15:17:00
0
What does this have to do with HTML/JavaScript (which this forum is all about)?
Android apps – ImageJ plugins – Java web charts
Sahana Hegde
Ranch Hand
Joined: Jan 27, 2008
Posts: 67
Well, I was not sure where to put it. Please let me know where I should post the same.
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
You could use HTML formatted email.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Sahana Hegde
Ranch Hand
Joined: Jan 27, 2008
Posts: 67
Thanks for the reply. How do I create HTML formatted emails. Can you please suggest any link. The first few links I found on google were not very helpful.
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
Use MimeMessage 's setContent(Object, String) method. The first parameter will be a String with the HTML content, and the second will be "text/html".
subject: Generate Email body