Jump to content

How many recipients can mail() handle?


Edward

Recommended Posts

 

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.

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.