• Post Reply Bookmark Topic Watch Topic
  • New Topic

sending email from a jsp page  RSS feed

 
pankaj saxena
Ranch Hand
Posts: 47
C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a website for Library Management system,
in this , i am using jsp , and i have one page that asks for email ids and some message to send, so what code should i use to send the information to different email ids.

please provide me some links or information about this problem.

thanks.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You wouldn't use a JSP, because JSP is for generating HTML and not for doing work unrelated to that. You would send the e-mail from a servlet before forwarding to a JSP.

And in the servlet you would write code to use JavaMail. (Google keyword: javamail.) It's built into your JEE processor so you don't need to download anything.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What Paul did not emphasize enough is that we are not talking about code inside a servlet class, but a utility class for sending email which you can create and test separately. When you have that utility class working right, THEN have your servlet create an instance and call it.

From long experience - try to keep your actual servlet class simple and pass information to utility classes for the actual work.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!