File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 20269

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...
jQuery in Action, 3rd edition