File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Send email directly from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Send email directly from a servlet" Watch "Send email directly from a servlet" New topic
Author

Send email directly from a servlet

Regus Patoff
Greenhorn

Joined: Oct 30, 2001
Posts: 8
I am processing form data and wish to send it as an email, but I DON'T want to have to go through Outlook Express or any other email process. Can Java format and send emails without help?
Thanks,
Regus
zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
use javax.mail package
there are some jsp tags can do it too,but i don't know where to downloaded them.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Lots of good stuff here:
http://java.sun.com/products/javamail/

The first download button is for the API itself. The jar files you need to write JavaMail code with. ( no link, it's a button )

Just in front of that button, note the download link to glasgow. You also need this download.
( http://java.sun.com/beans/glasgow/jaf.html )

Third thing to note is the API docs.
( http://java.sun.com/products/javamail/1.2/docs/javadocs/index.html )

Last, there is a good document available as PDF that shows sample code. ( no link, it's the second download button )

download buttons are labelled "continue".
Ken Shamrock
Ranch Hand

Joined: Jan 23, 2002
Posts: 139
Hi,
does JavaMail need use of smtp?


Thanks everyone who helped me
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
dear
u can even use sun.net.smtp classes.
then u need not download JavaMail.
& its easy to code too..
good luck
malhar
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
I wrote what is possibly the simplest servlet email "app" which gathers a few fields of text from a form and sends it to a predetermined address.
Since it's simple, it may be good for study but unusable for "industrial" purposes:
http://alicea.info/EmailServlet.zip


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Send email directly from a servlet