Results 1 to 8 of 8

Thread: How many TO: email addresses can MimeMessageHelper handle?

  1. #1

    Default How many TO: email addresses can MimeMessageHelper handle?

    All,

    Would the class:
    org.springframework.mail.javamail.MimeMessageHelpe r

    setTo(String[]) method able to handle about 25,000 email addresses?

  2. #2
    Join Date
    Aug 2004
    Posts
    109

    Default

    even if Mime message can contain this many email address in its TO field, I do not think it is a great idea at all (well I would say it is a silly idea if you ask me to be frank).

    You will get 25000 email consumers each of whom will get a 25000 eamil addresses in their email header.

    This question by the wya has nothing to do with Spring, but a lot to do with common sense.

    HTH,
    Alex.
    Thanks,
    Alex.

  3. #3

    Default

    Well Alex, clam down.
    How do you suggest to mail your user community if their email addresses are in your DB and not on a group in your SMTP server?

    BTW - I don't think email clients will show all anyway since I hope it would truncate.

    Would you suggest looping and mailing each one individually? What is your common sense on an approach to this? Don't flame, make suggestions? We all try to learn from each other here and how they have implemented similar solutions in the past. :wink:

  4. #4
    Join Date
    Aug 2004
    Posts
    109

    Default

    I am not flaming, I am just saying that sending all of theese emails in one email is no different than sending to each one indvidually. The difference only in who does the job. The drawback of sending 25K with 25K email addresses in it is obvious, comapring to 25K each one is with 1 address in the TO field.

    Think about it, if you put 25K email addresses in TO field what do you think your smtp gateway does with it, to send it out? It goes thru your TO field parses it, retrieves MX records for the domain of each one those emails and tries to communicate to each one of the hosts listed in MX record.

    Now if you think that just because you put all 25K addresses you will be sending one email is where common sense statement relevant.

    I am sorry if I ofended you in any way, it was not intended.

    HTH
    Thanks,
    Alex.

  5. #5

    Default

    Alex,
    I am in complete agreement with you. My issue is that this application is used worldwide and there is really no real downtime or off hours to have the application send 25K mime emails including multiple emails. I think this will cause a big performace hit to the application. So I do see the downside of sending the 25K in the To: field. But the SMTP server can handle the load since that is what it does. But I also know what the users will see in their To field. So what I really what to do is have the SMTP server handle the 25K email addresses but somehow have the email sent out with a single group name rather than the 25K email addresses in the To: field. can this be done? and can it be done using the MimeMessageHelper?

    I guess I am unable to locate a best practice design on this.

  6. #6

    Default

    I guess this is how to do it:

    Code:
    To send an email to undisclosed recipients:
    
        * Create a new message in your email client.
        * Insert "Undisclosed Recipients" in the To&#58; field, followed by your email address in "<,>" braces.
              o The To&#58; field should look like&#58; "Undisclosed Recipients <email.guide@about.com>". 
        * Put all the recipients' email addresses in the Bcc&#58; field, separated by commas.
              o The Bcc&#58; field could look like&#58; "semper@doubt.com, dh00@ladedu.com, ladedu@ladedu.com". 
        * Compose your message.
        * Send it.
    So now my question is can the setBcc(String[]) field handle the 25K email addresses?

  7. #7
    Join Date
    Aug 2004
    Location
    Toulouse, France
    Posts
    148

    Default

    the MimeMessageHelper is just a convenient wrapper around the javamail implementation and it simply iterates over the given array and call 25k times the setBcc method on the javax.mail.Message class.
    So, from the spring point of view, it is supported. It then depends on the chosen javamail implementation...

    Olivier

  8. #8

    Default

    Yes, I acknowledge that. And that is kinda where I am going with the question, but wanted to ensure that the Mimemessagehelper was not adding any great deal of overhead with any custom processing and restrictions (i guess I should look at source code). I am still trying to investigate what the Javamail API says for limits but nothing concrete. What I found is that admins can impose max charater limits on the to, cc and bcc fields and other fields as well on the SMTP server. Thank you.

Similar Threads

  1. Replies: 10
    Last Post: Apr 5th, 2008, 10:52 PM
  2. Replies: 7
    Last Post: Aug 28th, 2006, 05:30 AM
  3. Replies: 0
    Last Post: Aug 31st, 2005, 09:40 AM
  4. html jasperreports by email problem.
    By Yves Callewaert in forum Web
    Replies: 2
    Last Post: Feb 18th, 2005, 12:10 PM
  5. MimeMessageHelper - setting top-level MIME type
    By bmarklein in forum Container
    Replies: 0
    Last Post: Jan 2nd, 2005, 06:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •