aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes sample code for java mail api with attachment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "sample code for java mail api with attachment" Watch "sample code for java mail api with attachment" New topic
Author

sample code for java mail api with attachment

zeetha lakshmi
Greenhorn

Joined: Feb 23, 2012
Posts: 5
Dear All,

Any one guide me, how can i send mail with pdf attachment using java source(Java mail API).

Thanks & Regards
Zeetha.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
here is the two links, might helps you.

http://www.roseindia.net/javamail/
http://www.javaworld.com/jw-10-2001/jw-1026-javamail.html
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

If you look in your JavaMail download, you'll find a folder which contains example code. There's an example of how to send mail, including mail with attachments.
zeetha lakshmi
Greenhorn

Joined: Feb 23, 2012
Posts: 5
Dear All,

Thanks for your reply. Now i can sent mail with attachment using following code.

Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

Hi zeetha,

You can improve your code as a reusable component, like this.


PM Me If You Want to get Urgent Help on Java Programming
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: sample code for java mail api with attachment