Edward Posted January 11, 2008 Share Posted January 11, 2008 I pretty much asked my question in the subject...How many recipients can mail() handle? Are we talking a few, hundreds...thousands?? Is this a straight forward question with a straight forward answer, or does it depend on other things? Quote Link to comment Share on other sites More sharing options...
twostars Posted January 11, 2008 Share Posted January 11, 2008 I pretty much asked my question in the subject...How many recipients can mail() handle? Are we talking a few, hundreds...thousands?? Is this a straight forward question with a straight forward answer, or does it depend on other things? You can do as many as you want, in moderation. IE: IPB uses the mail function looped to loop through all the users instead of doing them all at once. Depends on: - server specs - server connection speed - number of users I guess. Quote Link to comment Share on other sites More sharing options...
revraz Posted January 11, 2008 Share Posted January 11, 2008 Probably should use PEAR if you have a lot. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 11, 2008 Share Posted January 11, 2008 It can do as many as you want, but it is not a good thing to place a mail function in a loop, and instead you should use Pear::Mail. Mail opens and closes an SMTP socket every time the function is called whereas Pear::Mail does not. Note: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient. For the sending of large amounts of email, see the » PEAR::Mail, and » PEAR::Mail_Queue packages. Quote Link to comment Share on other sites More sharing options...
Edward Posted January 11, 2008 Author Share Posted January 11, 2008 I'm not sure what PEAR is yet. This time I want to send to 200, am I ok to use mail() for that amount? If I have a script like below (but obviously not as basic): if (mail($recipient, $subject, $message, $headers)) { echo 'successfully sent to '.$recipient; } else { echo 'unsuccessfully sent to '.$recipient; } ...and put that in a while loop for all recipients, can I trust the output I get to tell me accurately whether or not it sent to each of the 200 recipients? I accept that it may not be DELIVERED, but that's dependent on the recipient. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 11, 2008 Share Posted January 11, 2008 They should all be delivered, but you may want to check with your host (If you use one) about the quantity of mail you can send per hour. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.