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 263801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:37:57+00:00 2026-05-11T22:37:57+00:00

I have a web app on JBoss 4.2.3 and I’d like it to send

  • 0

I have a web app on JBoss 4.2.3 and I’d like it to send email. I could do something like:

try {
Properties props = System.getProperties();
props.put("mail.transport.protocol", "smtp" );
props.put("mail.smtp.starttls.enable","false" );
props.put("mail.smtp.host","smtp.somehost.com");
props.put("mail.smtp.auth", "true" );
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
// -- Create a new message --
Message msg = new MimeMessage(session);
// -- Set the FROM and TO fields --
msg.setFrom(new InternetAddress("me@somehost.com"));
msg.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("recipient@somewhere.com", false));
msg.setSubject("yadayada");
msg.setText("Yada yada");
// -- Set some other header information --
msg.setHeader("MyMail", "Mr. XYZ" );
msg.setSentDate(new Date());
// -- Send the message --
Transport.send(msg);
}
catch (Exception ex) {
  ex.printStackTrace();
  System.out.println("Exception "+ex);
}

but it doesn’t feel right. Will this scale?

  • 1 1 Answer
  • 2 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-11T22:37:57+00:00Added an answer on May 11, 2026 at 10:37 pm

    How many messages are you sending ? Have you measured how long the above takes to run ? (I’m assuming that the major time sink will be in the actual send() to the MTA. Whether that’s significant is another matter)

    Perhaps:

    1. you need to queue the messages for sending to your MTA in a queue, and have the sending running in a separate thread ?
    2. you need an appropriate mailing list / alias set up, and thus only send one mail for ‘n’ recipients ?

    but all that hinges on how many messages you’re going to send, and how distinct the sets of recipients are.

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

Sidebar

Related Questions

We have a large web app installation, using Apache/Tomcat/Jasper and jboss. In development environment,
We have a web app built on Jboss that has been in production for
I have some difficulties deploying my web app on JBoss AS 6.1. My current
I have developed web app based on Jboss tutorial examples. In result login page
I have a Java web app that I'm developing, using JBoss Seam as the
I have the following xml block (a standard jboss web.xml file) : <web-app> <servlet>
I have a Web App deployed on JBoss App Server 7.0.2 on Windows XP
I have a web-app with a Java back-end that uses Tomcat jdbc-pool for database
I have a web app that runs fine in Visual web developer. But when
I have a web app built with Dojo 1.7.2, using RequireJS to load individual

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.