This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths 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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Email formating..." Watch "Email formating..." New topic
Author

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
Sheriff

Joined: Oct 27, 2005
Posts: 20048
    
  30

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
pradeep gamage
Ranch Hand

Joined: Aug 03, 2009
Posts: 85

Thank You Its Work for me...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Email formating...
 
It's not a secret anymore!