This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Generate Email body  RSS feed

 
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: 42970
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
Posts: 20893
81
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
Posts: 20893
81
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
Boost this thread!