tags:

views:

1341

answers:

3

I have an app which is programmatically generating and sending out emails. The recipients list can get upwards of 1000. I had been looping through and sending out individual emails, but that was taking too long at about .5 sec each. The approach I'm looking into now is to remove customization in the message body and send out a single email with all addresses in the BCC. (Maybe other solutions are possible and I welcome them, but I'm mainly interested in delving into the complexities of this BCC solution.)

Is there a limit to the number of recipients allowed on a single email? Is this wholly dependent on my email client and/or SMTP server's configuration? Are there other limits outside the control of my domain? Furthermore, how is BCC handled? I assume that the BCC distribution needs to be broken down into separate mail messages at some point. Is the mail client (in my case javax.mail) responsible for this, or does the mail server do this?

I'm also interested in suggestions of how can I test my new email blaster program?

I don't think it will be a valid test by creating 1000 accounts at google or wherever (nor do I want to). I've heard there are some mail server optimizations geared toward multiple recipients at the same host. In my case, most will be distinct hosts.

Another way is to involve all the recipients to see if they recieved the email. I can do this, but I want to avoid spamming them, assuming I may need to test multiple times if things don't go right the first time.

Or do I just assume some limitation and send out batches of emails with some arbitrary number of recipients each, say 50 or 100?

Oh yeah, and by the way, if anyone needs any Viagra, let me know. ;)

+3  A: 

BCC works inside your SMTP server; no recipients ever know other BCC'ed email addresses, so this is a limitation that depends entirely on your SMTP server.

You should check with your server administrator.

Seb
...whereupon they will boot you for sending UBE.
T.E.D.
I've never heard of BCC at the SMTP level. Is that a customization of some servers?
Chris Noe
What I meant is not that BCC is part of the Simple Mail Transfer Protocol, but that delivery to BCC recipients occurs inside the SMTP server.
Seb
If BCC is not part of SMTP, how is the SMTP server aware of the BCC list to send out each message? Or are you saying the the mail client is responsible for sending out a separate request for each BCC recipient. If the latter is true, it would seem there effectively no BCC limit for SMTP servers.
s_t_e_v_e
s_t_e_v_e: fun fact about SMTP: it doesn't actually care about the "To:" header in your Email. The list of recepients is sent separately outside of headers (using RCPT TO). BBC is implementing by simply not mentioning someone in the To: header that was mentioned in RCPT TO.
Joachim Sauer
@saua: Nice... didn't know how it was done exactly. Now I do, thanks! :)
Seb
@Seb: It is all documented in the RFCs. Sounds like you need to read them.
Stephen C
+1  A: 

Thanks for your comments. As I understand it now, the outgoing SMTP server will be responsible for breaking up each of the messages. In construction of the new messages, the outgoing SMTP server will only send applicable RCPT TO commands for each BCC recipient. So in the case where all recipients are BCC, there will be only one RCPT TO command for each message.

That being the case, it seems like I really only need be concerned about our outgoing SMTP server configuration. No need to worry about the destination SMTP servers.

I got a suggestion that seems like a good way to test this. I could send my message to a number of recipients, each with a unique bogus child domain of our valid parent domain. When no MX record is found for the child, the parent will be used. The outgoing SMTP server will not be aware that the bogus domains don't exist, so this should avoid any SMTP optimatization for multiple recipients with common domains. We can probably also configure that these messages will all get routed to the same inbox.

s_t_e_v_e
+1  A: 

even more definitive, the RFC that covers SMTP (2821) makes no mention of recipient limitations outside of mail-server specific ones:

"If an SMTP server has an implementation limit on the number of RCPT commands and this limit is exhausted, it MUST use a response code of 452 (but the client SHOULD also be prepared for a 552, as noted above). If the server has a configured site-policy limitation on the number of RCPT commands, it MAY instead use a 5XX response code. This would be most appropriate if the policy limitation was intended to apply if the total recipient count for a particular message body were enforced even if that message body was sent in multiple mail transactions."

http://www.ietf.org/rfc/rfc2821.txt

thepip3r