• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can we send Mail as response to a request?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
using servlets can we send response to a particular mail id for a specific request?

if yes somebody please tell me how to do this
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, why not. But don't forget it is good to respond the requesting user, at least a 200 message as a response.

It should go like

1. receive request
2. manipulate it
3. create email message
4. send the email
5. fabricate the response
6. send the response to the original sender of the request

Hope you got it.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to make it perfectly clear, the mail would be in response to the HTTP request, it would not be the response (which must be HTTP, obviously).

You'd need a mail server (or at least an SMTP server), and then you can use the JavaMail API to send mails. The http://faq.javaranch.com/java/JavaEnterpriseEditionFaq page contains many useful links regarding JavaMail, including extensive tutorials and sample code.
 
reply
    Bookmark Topic Watch Topic
  • New Topic