Get your CodeRanch badge!*
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 Java 8 in Action this week in the Java 8 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: 939
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: 18154
    
    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: 485

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sample code for java mail api with attachment
 
Similar Threads
how can i get attachmet via java mail api
Email
how to display a image file comming as attachment
providing email functionality using struts
How To Send Multiple Attachments In An Email