• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to send an automated mail upon registration?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
In my portal project, we have a requirement:
Requirement: When a user is registered (new user created), a mail needs to be sent to the administrator.

I need a headstart on this, it would be simpler for me if you could suggest links/resources (containing examples) that explain how this can be done .

Thanks
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
not that hard
get a mailsession from the container (see admin) (or, not as good: create your own)
create a javax.mail.Message with the session. Populate it and send.
see javax.mail package for details
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Quintessential Program to Send E-Mail [J2EE]
 
manoj rajkumar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the 2 responses, they provided an insight into the mail api.
but am getting more greedy here;
Is there an example that caters exactly to the requirement provided by my boss?
(Why make a design, when there is already an existing design pattern ? )
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember to provide for the situation in which the mail server is slow or not available. In other words, don't make the response wait on the mail sending process.

Bill
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Originally Posted by Chetan Parekh


The Quintessential Program to Send E-Mail [J2EE]


What are the changes required in this particular program if I want to use IMAP instead of SMTP.

Thanks & Regards.
Harshad
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMAP (like POP3) is a protocol for accessing mail stores, i.e. for receiving mail, not for sending mail. You'll have to use SMTP.
 
Good night. Drive safely. Here's a tiny ad for the road:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic