This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 931
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: 18120
    
    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: 484

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
providing email functionality using struts
how can i get attachmet via java mail api
how to display a image file comming as attachment
How To Send Multiple Attachments In An Email
Email