waynew Posted October 11, 2011 Share Posted October 11, 2011 I'm using PHPMailer on various websites. Recently, the host decided to restrict a number of functions. popen() was one of them. Problem is, PHPMailer uses popen in one of its class functions: function SendmailSend($header, $body) { if ($this->Sender != "") $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender); else $sendmail = sprintf("%s -oi -t", $this->Sendmail); if(!@$mail = popen($sendmail, "w")) { $this->SetError($this->Lang("execute") . $this->Sendmail); return false; } fputs($mail, $header); fputs($mail, $body); $result = pclose($mail) >> 8 & 0xFF; if($result != 0) { $this->SetError($this->Lang("execute") . $this->Sendmail); return false; } return true; } Is there some sort of alternative way to restructure this function? Quote Link to comment https://forums.phpfreaks.com/topic/248887-popen-problem/ Share on other sites More sharing options...
Muddy_Funster Posted October 11, 2011 Share Posted October 11, 2011 how about changing it to fopen()? Quote Link to comment https://forums.phpfreaks.com/topic/248887-popen-problem/#findComment-1278286 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.