Jump to content

popen problem


waynew

Recommended Posts

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?

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/248887-popen-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.