/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] php mail() doesn’t work for more than 100 mails.

[COLOR=”DarkOrange”][B][U]This problem im having about 5 days.[/U][/B][/COLOR]
[B]
this is my code…
[/B]

<?php
include ‘inc.php’;
$potential_client = new PotentialClient();
$potential_client->arrDelExpiredPotentialClients();

chdir(“../docs”);

$r = $potential_client->getmailclientss();

$From = “[email protected]”;
$FromName = “test”;

set_time_limit(1000);
ini_set(“max_input_time”,1000);
ini_set(“memory_limit”,”72M”);
$y = implode(”,file(“1191383828071003.html”)) ;
$x = array_pop($r);
$ii = 0;
while($x != FALSE){

$headers = “MIME-Version: 1.0rn”;
$headers .= “Content-type: text/html; charset=iso-8859-1rn”;
$headers .= “From: $FromName <$From>”;

mail($x->email, “APPOINTMENT LETTER” ,$y , $headers );
echo $x->email.'<br>’;
echo $ii++.'<br>’;
$x = array_pop($r);
}
echo “Operaion completed.”;

?>

[B]and this is ‘inc.php’[/B]

<?php
class PotentialClient
{
var $mDbm;
var $email;
var $emailSec;

function PotentialClient()
{
$this->mDbm = new DbManager();
}

function setPotentialclients($email, $emailSec)
{
$this->email = $email;
$this->emailSec = $emailSec;
}

function getmailclientss()
{
$r = “SELECT * FROM potential”;
$result = $this->mDbm->varGetData($r);
$arr = array();
if($result != FALSE)
{
$row = array_pop($result);
while($row != NULL)
{
$a = $this;
$a->setPotentialclients($row[“email”] ,$row[“emailSec”]);
array_push($arr , $a);
$row = array_pop($result);
}
return $arr;
}
else
{
return FALSE;
}
}
}
?>

But the problem is this script halts unexpectedly without displaying any errors.

It only sends about 80 mails. but i need to send more than 600 mails.

PLS HELP!!!!

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@NogDogOct 11.2007 — From the [url=http://www.php.net/manual/en/function.mail.php]mail() function[/url] page:

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 [url=http://pear.php.net/package/Mail]PEAR::Mail[/url] and [url=http://pear.php.net/package/Mail_Queue]PEAR::Mail_Queue[/url] packages.[/quote]
Copy linkTweet thisAlerts:
@UI-ZEIKVKauthorOct 11.2007 — From the [url=http://www.php.net/manual/en/function.mail.php]mail() function[/url] page:[/QUOTE]

Thanks for your help buddy!!

Now im starting to chek it out...
Copy linkTweet thisAlerts:
@rootOct 11.2007 — Also your host may have imposed a send limit per hour or per minute.

The host I use has 10 in 30 seconds limit or 100 per hour...
Copy linkTweet thisAlerts:
@UI-ZEIKVKauthorOct 12.2007 — Also your host may have imposed a send limit per hour or per minute.

The host I use has 10 in 30 seconds limit or 100 per hour...[/QUOTE]



how can i check that? i haven't permission to access php.ini. phpinfo() says it's 30. i don't know is it seconds or minutes.
Copy linkTweet thisAlerts:
@rootOct 13.2007 — You web HOST should have a FAQ which is accessed via the user control pannel for the server your using.

If they don't ask them directly.
Copy linkTweet thisAlerts:
@UI-ZEIKVKauthorOct 15.2007 — I check that and its 30 secs. finally i wet through. it happens becouse the mailing loop is starting before loading in and going to this page.

So, i finally print some mail addresses in the page. Then it worked!? i don't know why php script executes before the php page loads to the browser ? . Do you know why?

[B]Thanks NogDog and . for helping me on this matter. Thanks again!!![/B]
×

Success!

Help @UI-ZEIKVK spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...