Code: Select all
$sendmail_path = @ini_get('sendmail_path'); //Find the sendmail_path in the ini
$sendmail_path = str_replace(' -i', '', $sendmail_path); //If there is a -i get rid of it
if (function_exists('proc_open') && !empty($sendmail_path)) { //If the proc_open function exists and we have something in the sendmail path
$swift =& new Swift(new Swift_Connection_Sendmail($sendmail_path)); //Try it
}I did run into the fact that sendmail stop() was also getting called twice for some reason. This in turn cased the foreach to fail. To combat that I had to put it inside an is_array if statement.