tags:

views:

536

answers:

3

What kind of practical issues are there concerning sending tons of e-mail from a server? Will the likelihood of that e-mail being received be just the same as if it had been sent from g-mail or a personal e-mail account if I for example just blindly call the mail() function in PHP tens of thousands of times a day?

(note: you are not helping a spammer here, this relates to a notify feature I'm thinking about for a future link sharing site)

+1  A: 

It helps to set a 'x-mailer' and ('X-MimeOLE' if your pretending to be outlook) of a real mail client. It also helps to send it from a server that is a mail server for the domain in the from address, with forward & reverse DNS records setup.

Nick Kavadias
A: 

No issues. Once a server is correctly configured as a mail server (SMTP) for a particular domain, there is no difference if the mail it sends out came to it from Outlook, or from the mail() function in PHP - both are getting the SMTP server to do all the heavy lifting

I always make sure to set my X-Mailer headers correctly (identifying that the message was sent from within PHP) to ensure that any overzealous anti-spam services recognize it as an automatated notification as opposed to bulk/junk email. e.g.

$headers .= "X-Mailer: PHP/".phpversion();

All the configuration and limits you'll encounter are with the SMTP server, not from PHP. You can configure SMTP to rate-limit to 2 messages per second for example, this means if you queue up 1,200 messages they'll be drip fed out over the next hour rather than all at once (two is a really low number, 5-25 is more realistic).

SMTP is the backbone of email and some SMTP servers can happily handle tens of thousands of messages per minute (or more!) - the only limitation you'll likely face is bandwdith ;)

sascha
+2  A: 

While you may technically be able to send thousands of mails per minute, in reality you must be carefull.

Say you send out 500 emails to yahoo for example. if enough people mark your message as spam, soon, ANY email you send to yahoo will be marked as spam, or [BULK]. Many isp's routinely tar-pit or outright reject email from servers on lists such as RBL (the real-time black hole list). If your mail IP gets put on one of these lists, you can kiss sending email normally from that ip ever again goodbye. Users are very finicky and it doesn't take many complaints to get your mail ip blocked at many domains.

Also since you are sending automated messages, there are heuristics used to determine if the same message is being sent to many users on the same domain. This also increases the chance your mail will be marked as spam.

This is why clean emails from some addresses always go into the spam box. Their company may have not been careful enough when sending what could be perceived as spam. Proceed with caution.

http://wiki.apache.org/spamassassin/AvoidingFpsForSenders

http://support.microsoft.com/kb/842851

http://www.blacklistedip.com/rbl_list.php

Byron Whitlock