Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Send email directly from a servlet

 
Regus Patoff
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 416
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
does JavaMail need use of smtp?
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic