This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java in General and the fly likes Email formating... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Email formating..." Watch "Email formating..." New topic

Email formating...

pradeep gamage
Ranch Hand

Joined: Aug 03, 2009
Posts: 85

I am developing web application using java , spring and jsf 2.
So when user register with system, system automatically send a email.
This is email sending template


I want insert images and create look nice email template. Please give me idea to create email template.
Thanks in Advance...

Software Engineer(BSC):SCJP 1.5
(Knowledge is power when applied)
Rob Spoor

Joined: Oct 27, 2005
Posts: 20184

Use the Apache Commons Email library, in particular the HtmlEmail class, to create an HTML email message. You can use any formatting you want inside the HTML content. Images can be added inline through the example on the class' Javadoc page.

I'd also use the setTextMsg method to set a plain text part for those clients that do not support HTML emails. This should be a simplified version of your HTML part without all the fancy formatting and images.

How To Ask Questions How To Answer Questions
pradeep gamage
Ranch Hand

Joined: Aug 03, 2009
Posts: 85

Thank You Its Work for me...
I agree. Here's the link:
subject: Email formating...
It's not a secret anymore!