Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4096006
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:58:58+00:00 2026-05-20T19:58:58+00:00

I have created a registration form in JSP with an input field for email

  • 0

I have created a registration form in JSP with an input field for email address. When user submits the form, then the user must get an auto-reply on his/her email address. How can I achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T19:59:00+00:00Added an answer on May 20, 2026 at 7:59 pm

    Your question is not very clear.
    Let me get the requirement right; you need the code to send an email to the user only on successful registration. correct?

    In your servlet(which is invoked on submit action),

    if(user input is valid){
      Step1: registerUser();
      Step2: send confirmationEmail();
    } else {
      Step3: Exception case
    }
    

    Send email method would ideally send the request to an JMS(queue) to send the email to the desired user.
    Below is a snippet to send an email.

    //Sample java code to send email
    
    public void sendEmail(){
    
            try{
    
                Properties props = null;
    
                    if (props == null) {
                            props = System.getProperties();
                    }
    
                    props.put("mail.smtp.host", "<server host name>");
    
                    Session session = Session.getInstance(props, null);
    
                    MimeMessage message = new MimeMessage(session);
    
                    message.setFrom(new InternetAddress("<from email id>"));            
    
                    message.addRecipients(Message.RecipientType.CC, "<Registered user email id>");          
    
                    message.setSubject("<Subject of the email>");
    
                    message.setContent("<Content of the email>", "text/plain");         
    
                    Transport.send(message);    
    
                        logger.info("Sent Email :" + 
                            "From :" + message.getFrom() +
                            "To:" + message.getAllRecipients() +
                            "Subject:" + message.getSubject() );
    
                } catch(Exception ex){
                    ex.printStackTrace();
                }       
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created custom registration form in drupal 6. i have used changed the
Let's say I have an user registration form. In this form, I have the
I am trying to create simple user registration form. I have an index.html file
I have created a registration form and I send data to the controller. I
I have created a Django app. I have a registration page(simple HTML form) in
I have created a django application. The application has a registration form. I inserted
I have created a django app. It has got a user login/registration on the
I have created a C# class file by using a XSD-file as an input.
I need to add some extra field to Joomla registration form without using any
We have a registration form that asks for demographic information with the additional option

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.