• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generate Email body

 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this have to do with HTML/JavaScript (which this forum is all about)?
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I was not sure where to put it. Please let me know where I should post the same.
 
Rob Spoor
Sheriff
Pie
Posts: 20559
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use HTML formatted email.
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20559
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic