• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How send an automatic mail through my servlet

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks once again. I will check it out.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 11
Eclipse IDE Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Use two main Jar files activation.jar, mail.jar
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic