/    Sign up×
Community /Pin to ProfileBookmark

Hi there,

I set up an ubuntu linux server and then installed sendmail on it. it seems that it only sends 1 email per minute as maximum.

Is there any way i can change that?

Thanks

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@criterion9Sep 16.2009 — Is this a PHP problem or a server configuration problem?
Copy linkTweet thisAlerts:
@MindzaiSep 16.2009 — Is it definitely only sending 1 mail? Are you sure it isn't queuing mails? There are various options for queueing and limiting mails in the /etc/mail/sendmail.conf and /etc/mail/sendmail.mc files so it might be worth having a poke around. Note you need to use the m4 program to apply changes to the mc file though.
Copy linkTweet thisAlerts:
@stephan_gerlachauthorSep 16.2009 — I realised now that this is not the only problem. So currently it is sending only 1 email per minute and they also are being sent more than once.

I can't find anything in those 2 files but then I am not entirely sure on what I have to look for.
Copy linkTweet thisAlerts:
@stephan_gerlachauthorSep 17.2009 — I also just realised that if it sends only loads of emails when the script is started via cronjob. If I run the script via the browser each email is sent only once.
Copy linkTweet thisAlerts:
@MindzaiSep 17.2009 — But still only one per minute? Maybe the problem lies in either your script or the crontab setting (or both?). Can you post them?
Copy linkTweet thisAlerts:
@stephan_gerlachauthorSep 17.2009 — Yeah still only 1 per minute

crontab only 1 line

[CODE]
0 1 * * 1,2,3,4,5 wget http://10.115.0.243/cron/automated_reports.php
[/CODE]


this is the script
[code=php]
<?php

session_start();

include ('../classes/db.php');
$db = new db();
$db->connect();

$sql = 'SELECT * FROM automated_reports ';
$query12 = mysql_query($sql);
while ($result_reports = mysql_fetch_assoc($query12)) {

$day_minus = 1;
if (date('N')==1) { $day_minus = 3; }

$sql_1 = 'SELECT * FROM users WHERE id='.$result_reports['user'].'';
$query_1 = mysql_query($sql_1);
$result_1 = mysql_fetch_assoc($query_1);

$to = $result_1['email'];
$users = explode(',',$result_reports['users']);

foreach ($users as $user) {

$sql_u = 'SELECT * FROM users WHERE id='.$user.' LIMIT 1';
$query_u = mysql_query($sql_u);
$result_u = mysql_fetch_assoc($query_u);

$sql= 'SELECT * FROM client,notes WHERE notes.user='.$user.' AND
notes.date LIKE "'.date('Y-m-d',strtotime('-'.$day_minus.' day')).'&#37;"
AND notes.client = client.id ORDER BY client.company_name ASC';

$query = mysql_query($sql);
$message = '';

if (mysql_num_rows($query)>0) {

while ($result = mysql_fetch_assoc($query)) {

$message .= '<hr />';
$message .= '<table cellspacing="0" style="font-size:12px;">';
$message .= '<tr><td colspan="3"><b>Contact: </b>';
$message .= '<a href="http://10.115.0.243/index.php/telesale/details/'.$result['client'].'">'.$result['company_name'].'</a>';
$message .= '</td><td>&nbsp;</td>';
$message .= '<tr><td width="100" style="vertical-align: top;">'.$result['subject'].'</td><td width="100" style="vertical-align: top;">'.substr($result['date'],8,2).'/'.substr($result['date'],5,2).'/'.substr($result['date'],0,4).'</td><td width="100" style="vertical-align: top;">'.substr($result['date'],11,5).'</td><td>'.$result['text'].'</td>';
$message .= '</table>';

}

}

else {
$message .= '<p>No Contacts</p>';
}

$headers = 'MIME-Version: 1.0' . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
$headers .= 'From: System <[email protected]>' . "rn";

mail ($to,'Activity Report : '.$result_u['firstname'].' '.$result_u['surname'].' ,'.date('d.m.Y',strtotime('-'.$day_minus.' day')),$message,$headers);

}
}

echo 'Finished';

?>
[/code]
×

Success!

Help @stephan_gerlach 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 5.20,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...