FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: jonano on May 11, 2007, 06:03:55 PM

Title: what's the limit of mail();
Post by: jonano on May 11, 2007, 06:03:55 PM
what's the number of emails we can send with mail(); the limit..

--Jon
Title: Re: what's the limit of mail();
Post by: Ben on May 11, 2007, 07:30:45 PM
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.)
Title: Re: what's the limit of mail();
Post by: jonano on May 11, 2007, 09:05:01 PM
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;
}?>
Title: Re: what's the limit of mail();
Post by: jonano on May 15, 2007, 04:43:09 PM
so why I cant email 1000 users with mail(); ?

--Jon
Title: Re: what's the limit of mail();
Post by: admin on May 18, 2007, 03:36:53 AM
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