Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tables using JavaMail

I am sending an e-mail using JavaMail and I want to put my message data into a table that will be embedded in the e-mail. The person receiving the message will see the table with the filled in data. How do I go about doing this?

like image 665
Graham Avatar asked Nov 27 '25 20:11

Graham


1 Answers

I guess you mean HTML table?

StringBuilder sb = new StringBuilder();
sb.append("<html><body><table><tr><td>Bubu<td>Lala</tr></table></body></html>");
MimeMessage msg = ...;
msg.setContent(sb.toString(), "text/html");
like image 88
Jochen Bedersdorfer Avatar answered Nov 30 '25 10:11

Jochen Bedersdorfer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!