Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
jaid shaik
mail notification content
December 15, 2011 2:36 AM
Answer

jaid shaik

Rank: Regular Member

Posts: 170

Join Date: October 7, 2010

Recent Posts

Hi all,

mail notification with html content formate...Can any one help in this regard.

Thanks
Jaid
Tejas Kanani
RE: mail notification content
December 15, 2011 11:00 AM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 655

Join Date: January 6, 2009

Recent Posts

Hi Jaid,

I hope you are looking for how to send html mail.
Check out below code it might help you.

 1
 2import javax.mail.internet.InternetAddress;
 3import com.liferay.portal.kernel.mail.MailMessage;
 4import com.liferay.mail.service.MailServiceUtil;
 5
 6final InternetAddress from = new InternetAddress(fromAddress, fromName);
 7final InternetAddress to = new InternetAddress(toAddress, toName);
 8final MailMessage message = new MailMessage(from, to, subject, body, htmlFormat);
 9MailServiceUtil.sendEmail(message);


just pass htmlFormat as true and it will send mail as html format. And in body pass your html code as a string.
jaid shaik
RE: mail notification content
December 16, 2011 4:24 AM
Answer

jaid shaik

Rank: Regular Member

Posts: 170

Join Date: October 7, 2010

Recent Posts

Thanks tejas......its helpful.