effi
effi

Reputation: 64

Styling java mail (without user interaction)

I am able to send mail without user interaction through java mail. How can I style (size, bold, color) the text (body) of the mail?

Edit: I'm using code I found to [send mail without user interaction][1].

Upvotes: 0

Views: 421

Answers (2)

effi
effi

Reputation: 64

Thank You Bill Shannon you are right i need to send html text, and Krylez as well.

The way to do it is to change this part of the send() method in Mail Class/Mail.jave file:

// setup message body

BodyPart messageBodyPart = new MimeBodyPart();

messageBodyPart.setText(_body);

_multipart.addBodyPart(messageBodyPart);

To this

// setup message body

BodyPart messageBodyPart = new MimeBodyPart();

messageBodyPart.setContent(_body, "text/html");

_multipart.addBodyPart(messageBodyPart);

Upvotes: 0

Related Questions