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?

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.