Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How send an automatic mail through my servlet

 
Paul Okeke
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want a situation where by, on submittion of a form.
My servlet will automatically send the user a confirmatory email
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java API for sending mail is called JavaMail. See the JavaEnterpriseEditionFaq for links to an extensive tutorial with many code examples. You'll need access to a mail server.
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Okeke wrote:I want a situation where by, on submittion of a form.
My servlet will automatically send the user a confirmatory email

after submiting the form you will get the details in your servlet ....if you want to make any db operations do it first ...then just call a method of a helper class which will send mail for using java mail API ...

also send the values you had taken from form to the method through arguments (like mySendMailFunction(name,age,location))
take these values in your helper method and do the reaming coding ..for that just check the below link

samplecode
 
Paul Okeke
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for that response!
But please, can you help me with a download link to that source?
Or any other source that will guide on the use of Java Mail API.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11944
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Okeke wrote:But please, can you help me with a download link to that source?

Lester pointed you to the JavaEnterpriseEditionFaq - if you look in there you will find links to the JavaMail Home page, the FAQ, Introduction, tutorials, and much more.
 
Paul Okeke
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks once again. I will check it out.
 
rewati raman
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after submiting the form you will get the details in your servlet ....if you want to make any db operations do it first .. then as was told earlier call a method or a simple pojo method to send an email. you can do it using socket and smtp. that will work.
 
sarath j nair
Greenhorn
Posts: 11
Chrome Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Use two main Jar files activation.jar, mail.jar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic