aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes How send an automatic mail through my servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "How send an automatic mail through my servlet" Watch "How send an automatic mail through my servlet" New topic
Author

How send an automatic mail through my servlet

Paul Okeke
Ranch Hand

Joined: May 16, 2009
Posts: 58
I want a situation where by, on submittion of a form.
My servlet will automatically send the user a confirmatory email


OCJP 1.6
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
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

Joined: Jun 07, 2010
Posts: 129

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


VIJINDAS
Paul Okeke
Ranch Hand

Joined: May 16, 2009
Posts: 58
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

Joined: Mar 28, 2003
Posts: 11460
    
  94

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.


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Paul Okeke
Ranch Hand

Joined: May 16, 2009
Posts: 58
Thanks once again. I will check it out.
rewati raman
Ranch Hand

Joined: May 22, 2010
Posts: 62
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

Joined: Nov 10, 2011
Posts: 11



Use two main Jar files activation.jar, mail.jar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How send an automatic mail through my servlet