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

  • Home
  • SEARCH
  • 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 547437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:58:23+00:00 2026-05-13T10:58:23+00:00

I am creating a form, which will send out the details via email upon

  • 0

I am creating a form, which will send out the details via email upon user completes his details and click submit.

Mail Submission with JavaMail:

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

    PrintWriter out = response.getWriter();
    try {
        String host = "localhost";
        String from = "root@localhost.localdomain";

        try {
        Properties props = System.getProperties();
        props.put("mail.smtp.host", host);
        props.put("mail.smtp.user", from);
        props.put("mail.debug", "true");

        Session session = Session.getDefaultInstance(props, null);
        session.setDebug(true);
        Transport transport = session.getTransport("smtp");

        MimeMessage message = new MimeMessage(session);
        Address fromAddress = new InternetAddress("root@localhost.localdomain");

        message.setFrom(fromAddress);

        InternetAddress to = new InternetAddress("sendToAliases@localhost.localdomain");
        message.addRecipient(Message.RecipientType.TO, to);

        message.setSubject("Email Details Sending");
        message.setText("This is my testing content.");

        transport.connect(host, from);
        message.saveChanges();
        Transport.send(message);
        transport.close();
    } finally { 
        out.close();
    }
} 

I am using Email aliases for sendToAliases@localhost.localdomain which means I could have 4 email aliases from sendToAliases. However, I am unable to reach any emails upon deploying and running the above mail file. Can anyone please advise me?

Thank you.

  • 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-13T10:58:23+00:00Added an answer on May 13, 2026 at 10:58 am
    • Have you checked the log files?
    • Do you get any exceptions or errors when running the program?
    • Do you have a SMTP server running in localhost?
    • Is the SMTP server accepting connections from localhost?
    • Can you send emails via that server using normal email client and receive them somehow?
    • Try to make your program a standalone commandline program and try to execute it

    You seem to have a missing quote in message.setSubject("Email Details Sending);. Are you sure that your servlet actually compiles?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a form which allows the user to choose an email cover
I am creating a form designer. It will generate PHP code which will produce
I am creating a registration form which contains two submit buttons. I need to
I am creating an user registration form using jsp,in which there is an option
Good morning everybody. I am creating the form which will help my children to
I am currently creating a class to handle all my form data which will
I am creating a JPanel form which will contain several other JPanels. I want
I am creating a rails app which will help out businesses. These businesses have
I'm creating some text boxes on my form programmatically which I need to reference
I frequently find myself creating classes which use this form (A): abstract class Animal

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.