File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Attach PDF In mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Attach PDF In mail" Watch "Attach PDF In mail" New topic
Author

Attach PDF In mail

Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Hi, I am using Apache Common mail api to send e-mail and it's working fine.
Now i want to attach pdf as an attachment to the mail, content of attachment is an xhtml page of which I am passing url in my below code.
Actually I am able to attach attachment but the problem is, attachment is attached as .htm but I want as pdf.


Please help me to solve this.
Thanks in Advance.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Aggarwal Arpit wrote:Now i want to attach pdf as an attachment to the mail, content of attachment is an xhtml page of which I am passing url in my below code.
Actually I am able to attach attachment but the problem is, attachment is attached as .htm but I want as pdf.


I'm not sure I understand this. You're saying you want to attach a PDF file. But in fact you don't have a PDF file, you have an HTML file. And when the recipient opens the attachment, it is surprisingly an HTML file. It almost sounds as if you thought that calling it a PDF file would somehow make it be a PDF file.

So could you clarify your question a bit?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Attach PDF In mail