This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Attach PDF In mail
 
Similar Threads
Image as part of HTML email
Sending PDF as Input Stream
Struts and Chineese characters
generating text file and sending that file as mail attachment
Sending mail with attachment using HTMLEMAIL