News:

The "Support Requests" forum is now viewable by guests.

Main Menu

what's the limit of mail();

Started by jonano, May 11, 2007, 06:03:55 PM

Previous topic - Next topic

jonano

what's the number of emails we can send with mail(); the limit..

--Jon

Ben

That really depends. Spam emails are limited to 0 per accont.

But the maximum.. it depends on your script. If you're trying to send 1 million emails at once, then you'll cause the server problems. But if it tries to send it in batches of 15 or so, then it shouldn't cause the server problems.

Mainly, you just want to avoid spam.

(Note: admin may have a specific limit on how many you may send, but I don't know of any limit like that. Just because I don't give a specific number, doesn't mean there isn't one.)
--Ben
Ben@freepgs.com

jonano

here is my code, and I try to send an invitation to all of my gmail contacts which is about 1100 emails:

is my code ok ? when I try 2 emails it works, but not when I try 1000.

<?php session_start(); ?>

<?php

if(isset($_SESSION['user'])) {

include("mysql.php");

$sqlinvite = "SELECT * FROM tbl_auth_user WHERE user_id = '$user' ";

$result_invite = mysql_query($sqlinvite);

while ($line = mysql_fetch_assoc($result_invite))

{

$from = $line["email"];

$mails = str_replace("\n",',',str_replace("\r",'',$_POST["emails"]));

if(isset($_POST["emails"])) {

mail("$mails", "$user invite you to view and rate his/her profile", "AVAKL is a person to person lending online marketplace. \n\n $user invite you to rate and view his/her profile on AVAKL (http://{$_SERVER['SERVER_NAME']}/user.php?user_l=$user\), if you don't want to rate or view the profile, disregard this message. \n\n Thanks.", "From: $from", "Reply-To: $from");

}

else {}

}
?>


<?php

echo"Thanks. You invited your friends.<p><a href=\"javascript: history.go(-1)\">Back</a>";

}





if(!isset($_SESSION['user'])) {

include "login.php";
  echo "<center>You need to log in or <a href=\"signup.php\">register</a> to access our site. You are currently not.</center>";
exit;
}?>

jonano

so why I cant email 1000 users with mail(); ?

--Jon

admin

We are not limiting the number of emails that can be sent.

As suggested many times before, you may need to set a higher exec time limit via "set_time_limit(n)"
i.e. to set the time limit to 120 seconds, add this line to the top of your file
<?php set_time_limit(120); ?>

Of course, you could also have an invalid email address or improperly escaped text in your database causing you problems as well.  Without more information (like a specific error message or behavior when you try to send 1000 messages) we cannot provide more information to you.

Thank you,
FreePgs.com Admin