learner
learner

Reputation: 905

Create a HTML Email from Java

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

Upvotes: 0

Views: 6402

Answers (2)

Patel TiLAK
Patel TiLAK

Reputation: 74

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

Upvotes: 0

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.

Upvotes: 1

Related Questions