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 program which can send test or data to Bluetooth devices.
I need to create module in Magento which will have few database tables. One
In my form I have a listview and a panel which is used as
I will see if I can explain this clearly enough. I have 2 web
When creating a pipe with os.pipe() it returns 2 file numbers; a read end
Hey guys... I'm working on creating one of my first websites and currently have
When you create a new Windows Forms application, what's the easiest way from dropping
I'm building an application using ASP.net MVC 3 and I'm wondering if anyone knows
I have been perusing the internet in search of the best way to accomplish
So i just started using ASP.NET MVC and i'm really liking it, except i

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.