...

View Full Version : sleep command



TheLethal
12-29-2006, 06:11 PM
hi basicly ive a mailing script and i was wondering how i make the script send emails out in batchs to not look like spam
heres my script

<?php

error_reporting(E_ALL);

require('phplistgrab.php');

if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$phplistgrab = new phpListGrab($_POST['passport'], $_POST['password']);
$phplistgrab->grab();

// Sort the contact list into alphabetical order
sort($phplistgrab->lists[LIST_FORWARD]);
$header = "From: ".$_POST['passport']." <".$_POST['passport'].">\r\n";


foreach ($phplistgrab->lists[LIST_FORWARD] as $contact)
{

$to = $contact['passport'];
$subject = 'Check my webpage plz';
$message = 'Hello Friend.
You Have Been Invited By Someone On Your Contact List To Join http://www.aur-phala.com/forum/register1.php <<Click To Join.
Join the ever expanding music site that is http://www.aur-phala.com/forum/register1.php . There are many features on the site which include:

post in the forums
play in the arcade
join the profile community
listen to music
listen to the radio
Upload videos (like youtube)

So do not hesitate and join the revolution at http://www.aur-phala.com/forum/register1.php

So Sign Up Today And Invite Your Friends To.
Thank you,

Your Friend @ http://www.aur-phala.com/forum/register1.php';

mail($to, $subject, $message, $header);
}
}
else
{

echo <<<EOT

<META
HTTP-EQUIV="Refresh"
CONTENT="2; URL=http://aur-phala.com/forum/register.php?do=register&agree=1">

</head>
<body>

<form method="post" action="index.php">

<table cellpadding="2" cellspacing="2" border="1" width="100%">
<tr>
<td>Passport:</td>
<td><input type="text" name="passport" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="pie" value="Submit" /></td>
</tr>

</table>

</form>

EOT;

}

?>

xconspirisist
12-29-2006, 08:23 PM
Sleeping is generally a bad idea. Especially in your case, it will make the script look likes it's hung. You would be best to do this on your mailserver process messages with a delay, if you are able to set this up.

If you *really* want to make your php script sleep, you should look at this function:

http://php.net/sleep

Note that it sleeps on a per seccond basis, and only accepts int's. You wont be able to sleep for half a seccond.

If you want to sleep on a microseccond basis. You will need the usleep function. The manual reference can be fuond here:

http://php.net/usleep

TheLethal
12-29-2006, 10:55 PM
what about making it email in batchs without sleep command

xconspirisist
12-30-2006, 12:15 AM
It depends if you have access to the mailserver configuration.

If so, that's a postfix/sendmail configuration option.

TheLethal
12-30-2006, 12:27 AM
i have access to WHM panel

TheLethal
12-30-2006, 01:25 PM
anyone help me with this? to make it send in batchs of 15 or so

TheLethal
12-30-2006, 07:09 PM
bump
anyone,wud be gud to fix this asap



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum