Click here to Skip to main content
15,039,729 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am sending a notification mail using the javamail and the message text which i need to render has a table. My problem is when the mail is received, i need to show this table structure in the mail.

Is there anyway i can do this.

My message text code goes like this

XML
messageText.append("Dear Approver,");
            messageText.append("\n");
            messageText.append("The following lounge information changes are waiting for your approval");
            messageText.append("\n");
            messageText.append("<table>");
            messageText.append("<tr>");
            messageText.append("<td>Airline Code</td>");
            messageText.append("</tr>");
            messageText.append("</table>");



but it shows the message as
XML
Dear Approver,
The following lounge information changes are waiting for your approval
<table><tr><td>Airline Code</td></tr></table>


---------
Basically i want to render a table with the content i set when the message is sent.
any help will be greatly appreciated.
Posted

1 solution

You should make the body as HTML instead of Text(mostly which is default).
Refer following link Sending HTML based email using Java[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900