0

I had a jSON Object which i have parsed using JSON-Java library, Now i want to put the relevant content as a HTML table and circulate using email. Please suggest the best and neat approach to do so, Also, please point to any resources the may be interesting.

Thanks

2

2 Answers 2

1

Use JavaMail to create a MIME-email with a text/html attachment, and then put your HTML in there. Configure JavaMail with the recipient, subject, SMTP-server etc, and ask it to send the mail.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the java mail help, How would you suggest to generate HTML Content within my Java program.. I have a parsed a huge json file and saved them as Json Array and values..
I would probably transform the JSON structure into a real Java object, and use a template engine like freemarker.
0

You can create variable "body" and store in it code for HTML Table created using tags. Visit w3chools.com for more information about HTML Table. You can use tools like Dreamweaver also if u want to create table with rich graphics and copy the code to variable.

Then you have to do is convert static table into dynamic to use json Parsed Values. Just replace static values and use loops to generate multiple rows.

Good an Easy Tutorial on sending HTML Emails is available at http://www.tutorialspoint.com/java/java_sending_email.htm

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.