cancel
Showing results for 
Search instead for 
Did you mean: 

How to change font type in java mail script?

Former Member
0 Kudos

Hi,

I wrote a bean shell script to send mail on particular event. I want mail message body text font style to be modified.

Please provide help on this.

Thanks,

Saloni

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Saloni ,

You can add the text in the following way by using font tags for message body in your custom mail.


Message msg = new MimeMessage(session);
MimeMultipart mp = new MimeMultipart();
MimeBodyPart mbp1= new MimeBodyPart(); 
String htmlText = "<b> This is formatted</b>"+
"<font size =\"5\" face=\"arial\" >This paragraph is in Arial, size 5</font>";
mbp1.setContent(htmlText,"text/html");
mp.addBodyPart(mbp1);
msg.setContent(mp);

It worked for me. Let me know if you face any issue.

Regards,

Uday.

Answers (0)