Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not execute mail delivery program

$this->load->model('emailmodel');
$query = $this->emailmodel->get_emails();
$emails = array();
set_time_limit(0);

foreach($query->result() as $u)
{
    $this->notification->send($u->to, $this->config->item('neworder'),'orders/mail/subscription', 
        array(
            'order' => $neworder,
            'user' => $user
        ));
    break;
}

so I am sending mail in a loop for each subscribed user, but it gives me an error:

Could not execute mail delivery program '/usr/sbin/sendmail -t -i '

how to fix this?

like image 911
Zecrow Avatar asked Dec 08 '12 23:12

Zecrow


2 Answers

I think your system doesn't support sendmail in that path.. You have to change the sendmail path or reinstall it and be sure that your queue mail isnot overloaded...

like image 128
Eko Avatar answered Sep 28 '22 11:09

Eko


We had the same problem. please check the security limits on your system (ulimit)

You can execute ulimit -a

bash# ulimit -a

...
open files (-n) 1024
max user processes (-u) 1024
...

You can change this on RedHat in /etc/security/limits.conf We have change the nproc and nofile to a bigger value.

Because each mail() call opens a port(file). If you reach the Filelimit this errormessage occurs.

like image 27
gran Avatar answered Sep 28 '22 09:09

gran