• Post Reply Bookmark Topic Watch Topic
  • New Topic

send mail with pdf attachment

 
gaurav kumawat
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ve invoice.jsp in which i extracted the html part(say in variable "htmlMessage") using copy tag and passes it to sendMail.jsp there i m sending it to customer.It is received to customer in text format.I need that this can be send in PDF format as attachment.
Plz help..
Thank you..
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to convert the text into a PDF document using a library like iText and then use the JavaMail API to attach that PDF to an email. Niether of wich are specific to JSP.
 
gaurav kumawat
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir i m not geeting u.Let me explain my problem.I extracted the html part from invoice.jsp in a string variable htmlMessage.And now i need that i can send that htmlMessage content can be send it as attachment in pdf format.
Pz help in this..
Thanks..
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gaurav kumawat:
sir i m not geeting u.Let me explain my problem.I extracted the html part from invoice.jsp in a string variable htmlMessage.And now i need that i can send that htmlMessage content can be send it as attachment in pdf format.
Pz help in this..
Thanks..


I'm not sure how to explain it differently. But I will try...

You'll need to convert your htmlMessage content into a PDF document using an API like iText. Once you have generated the PDF, you will need to use the JavaMail API to send the PDF as an attachment in an email.

If you can clarify exactly what part of that you don't understand, maybe I can clarify it a bit more.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JSPs for rendering the views only. For business functionality like creating a pdf and sending mails, use a Servlet instead.
 
gaurav kumawat
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much..sir..
 
gaurav kumawat
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir would u plz tell me..how to convert htmlMessage content into a PDF document using an API like iText.Means which particular method should i use.
Thank you..
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gaurav kumawat:
sir would u plz tell me..how to convert htmlMessage content into a PDF document using an API like iText.Means which particular method should i use.
Thank you..


gaurav,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see: UseRealWords

Abbreviations such as "u" or "ur" in place of "you" and "you are"
or "you're" confound language translation software making it hard
for our non-English speaking members to read your posts.
"Plz" is not a word in the English language.

Thank you for your help with this.


As to your question.
Since this is not really a JSP issue anymore, I'm going to move this thread to the "Other Open Source Projects" where IText and Apache FOP would be covered.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!