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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:53:58+00:00 2026-06-08T19:53:58+00:00

My email code works well when I just send an email to a few

  • 0

My email code works well when I just send an email to a few people, but when I sending to all users(177) in contact, I got this error:

[ERROR]  - org.apache.commons.mail.EmailException: Sending the email to the following server failed : hlrdwd.com:25

The code is below:

HtmlEmail email = new HtmlEmail();
        email.setCharset("utf-8");
        if (vo.getContent() != null && vo.getContent().trim().length() > 0) {
            email.setHtmlMsg(vo.getContent());
        } else {
            email.setHtmlMsg("   ");
        }
        email.setSubject(vo.getTitle());
        email.setFrom(vo.getSender(), currentuname);
        email.setHostName(Property.getSmtp());
        List<Map<String, String>> toList = mm.formatAddress(vo
                .getReceiver());
        if (toList != null) {
            for (int i = 0; i < toList.size(); i++) {
                Map<String, String> tMap = toList.get(i);
                email.addTo(tMap.get(mm.KEY_EMAIL), tMap.get(mm.KEY_NAME));
                System.out.println(tMap.get(mm.KEY_EMAIL));
            }
        }
        email.setAuthentication(currentuser, password);

        String messageid = email.send();

I google this and add email.setTLS(true);, but still can not work. Waiting your help!

  • 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-06-08T19:54:01+00:00Added an answer on June 8, 2026 at 7:54 pm

    The problem is that the receiving mail server doesn’t like messages being sent to too many people at the same time. As a reference, postfix by default rejects messages with more than 50 recipients.

    The simplest solution is to send multiple messages, rather than sending to everyone at once. In the extreme, you could send a message per user — then you get the opportunity to customise the messages if you want, which also makes them less likely to be filtered as spam.

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

Sidebar

Related Questions

I have this code, and all works well in my local server. The email
The code below works great except the email has all the text on one
Below is the code I have for sending email which works great. /* *
The code below works well in Safari but in Chrome and Firefox the form
I've the next problem: The code to validate the name, address and email works,
I have this email sending code that does not show a chooser (good). How
I am about to send an html email in code that may contain unsafe
When I am trying to execute following code to email the contact form details,
My code for sending email through Gmail's smtp: SmtpClient client = new SmtpClient(smtp.gmail.com, 587);
I wrote a single console application (just a part of a site code, but

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.