Bcc Emails
Moderator: General Moderators
Bcc Emails
For sending (possibly 100s if not more) e-mails, from doing a search I've found that people seem to reccomend doing a Bcc for each e-mail address, rather then sending individual e-mails. Is there a limit to how many bcc's you can do in one e-mail? and is this indeed the most effecient way of doing things, ie. just calling mail() once with all the addresses in the Bcc field, thanks.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Are you a spammer? 
Is there a limit? Depends on how your SMTP server and the receiving servers are set up. Here's a good URL I just discovered recently via Slashdot that comprehensively talks about antispam tools (one of them penalizing massive amounts of incoming messages):
http://www.acme.com/mail_filtering/
And specifically:
http://www.acme.com/mail_filtering/send ... meset.html
Is there a limit? Depends on how your SMTP server and the receiving servers are set up. Here's a good URL I just discovered recently via Slashdot that comprehensively talks about antispam tools (one of them penalizing massive amounts of incoming messages):
http://www.acme.com/mail_filtering/
And specifically:
http://www.acme.com/mail_filtering/send ... meset.html
If you are legit, you should be okay as long as your SMTP, then, allows it (if you can make direct connections out, you're in the clear).MAX_RCPTS_PER_MESSAGE
This setting limits the number of recipients allowed on each message. Some spammers try to deliver messages to thousands of recipients at once; this prevents that. If a message comes in with more than the allowed number, the excess recipients are rejected. The recipients under the limit are accepted and get delivered; the excess recipients get retried later, assuming the sending system is a real standards-conforming mailer. Of course the spammers are not running real mailers, so they won't retry.
I set the limit to only ten per message:
define(`confMAX_RCPTS_PER_MESSAGE', `10')dnl
I can go this low because there's really only one user on the site: me. Most sites will probably want to use a higher limit. But again, if the sending system is working properly, the mail will eventually get through to all recipients regardless of this setting.
One downside to this setting is that it applies to outgoing mail too, so I can't send mail to more then ten people at a time because my mail program isn't smart enough to retry the excess recipients. There's probably some way to configure things so this only applies to incoming mail, but I haven't looked into it.
If your email addresses are stored in database, it would be better to use looping to send an email to each of the email addresses. For example,
Code: Select all
$message = "Your message here";
$subject = "My Newsletter";
$from = "youremail@domain.com";
$query = "SELECT * FROM tbl_newletter ";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$name = $row['name'];
$email = $row['email'];
$message = "Dear ".$name.",\n\n".$message;
mail($email, $subject, $message, $from)
}
mysql_free_result($result);I wouldn't follow this advicezippee wrote:If your email addresses are stored in database, it would be better to use looping to send an email to each of the email addresses. For example,
Code: Select all
$message = "Your message here"; $subject = "My Newsletter"; $from = "youremail@domain.com"; $query = "SELECT * FROM tbl_newletter "; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $name = $row['name']; $email = $row['email']; $message = "Dear ".$name.",\n\n".$message; mail($email, $subject, $message, $from) } mysql_free_result($result);
Edit: ..because mail() opens and closes a connection to the SMTP server each time you call it, and takes ages to do so.
Jcart | Edited Post
Back in the day when I worked on an intranet install of the old "Alexandra" (sourceforge.net code) codebase, I remember digging around their mass mail features. It looped over the target email from the DB, building up a bcc string of upto 25 and sending, repeat until all sent. Seemed to do a nice balancing between the time to connect to the mail server and the likelihood of false positives on spam detection.
Following such an approach, if you start to have problems with your mail being labelled as span you can lower the number of bcc's per batch and see if that fixes it -- however, the more likely problem is that other aspects of your headers/subject/text are screaming spam -- most spam filters requires a combination of a lot of factors.
Following such an approach, if you start to have problems with your mail being labelled as span you can lower the number of bcc's per batch and see if that fixes it -- however, the more likely problem is that other aspects of your headers/subject/text are screaming spam -- most spam filters requires a combination of a lot of factors.
Most end-user side ones, yes (things like SpamAssassin, or the ones often trained by "Junk/not-Junk)
Some ISPs are rolling out similar tools at the incoming mail side, attempting to reduce their bandwith usages and stopping the spam from traversing their network.
A few are using other methods, like the ones mentioned on slashdot, which are more strict.
Some ISPs are rolling out similar tools at the incoming mail side, attempting to reduce their bandwith usages and stopping the spam from traversing their network.
A few are using other methods, like the ones mentioned on slashdot, which are more strict.