Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Html mail with dynamic contents  RSS feed

 
Jyotee agarrwal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I need to send very structured HTML emails with javamail APIs. E Mails will include tables and data retrieved from backend.
And it need to be send automatically via scheduler.

I was figuring out how to most easily create the HTML content.

I would appreciate any suggestion toward a simpler solution (which does not involve servlet development )

Thanks in advance,
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need Servlets to do this.

To create the HTML content you probably need some sort of templating engine. There are a bunch of them.

To schedule this all you need is a Timer.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An email is not a web page - it is created when the email is sent, not when it is opened. So any content is static as of the moment you add it to the mail.

What you can do is include images that will be resolved at viewing time; if the src attribute of those images points to something on the server, then the image contents can be created dynamically. Note that many users and/or email clients choose to block images in emails.

Rather easier, can you include a link to a dynamic web page in the mail?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!