This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Send e-mail from servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Send e-mail from servlet?" Watch "Send e-mail from servlet?" New topic

Send e-mail from servlet?

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
I want to design my servlet to work as follows:
1)The user key in some value in browser
2)The servlet uses the keyed value to get data from database and then formats a PDF file (in memory)
3)The servlet sends this PDF to a number of people (e-mail address pre-stored)
4)In the meantime, the servlet notifies the browser user.
How do I do the third step: e-mail a file (in memory) to somebody?

We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Dave Soto
Ranch Hand

Joined: Sep 15, 2001
Posts: 55
This is really a pretty big question, and I'll answer it by pointing you in the right direction: Javamail. Read up on it, because sending mail from a servlet involves setting up an SMTP server among other things, but there is of course tons of information available on how to do it.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks Dave.
I am reading JavaMail. Just wondering if anybody knows some utilities that will do then trick.
Consider Paul's rocket mass heater.
subject: Send e-mail from servlet?
Similar Threads
Cache file(pdf) in user's computer using Servlet-Cookie, or Session
JavaMail question
PDF plugin problem
sending email
Create e-mail via servlet