• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Limit on the number of email addresses in the 'To' field

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we have a distribution list of 2000 users in the list.

we have used message.addRecipients() to send out an email using java mail. we have done this because the business wants only one email to be going out to 2000 users. and not one email/person.

however, we get outofmemoryerror, when we run the prg. the jvm heap size is 2GB size. when we tried to increase the heap size beyond this, the jvm could not be initialized.

please let me know what is the max limit of email addresses, that can be put in the 'To' field at a time? is there a limit?
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's about 5.

Ok, now seriously. NEVER EVER EVER!! send out a mass email with that many people in the To address. If ever you need need to send out emails to many people, put them all in the BCC field, and yourself or a no-reply address or something like that in the To field.
If you don't, someone is 100% certain to forward the email, it gets forwarded a few times more and in the end some spammer gets it and has an extra 2000 email addresses to spam to.


Now ontopic. Whenever you put all 2000 addresses in the BCC field instead of the To field, you're very likely going to get the same problem. Now why 2GB shouldn't be enough for 2000 addresses (that's just over 2MB per address!) is something I can't answer you. Do you get the same problem if you use only 500 users? Are you adding huge attachments?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic