background image

        

        

if

 (

$this

->strHost=='') 

        

            

$this

->strHost = 

substr

(

strrchr

(

$this

->strEmail, "@"), 1); 

        

        

if

 (

$intPort

!='') 

        

            

$this

->intPort = 

$intPort

        

        

$this

->connectHost(); 

    

 

    

//连接服务器 

    

function

 connectHost() 

    

        

if

 (

$this

->bolDebug) 

        

            echo

 "Connection ".

$this

->strHost." ...\r\n"; 

        

        

if

 (!

$this

->getIsConnect()) 

        

            

if

 (

$this

->strHost=='' || 

$this

->intPort=='') 

            

                

$this

->setMessage('POP3 host or Port is empty', 1003); 

                

return

 false;             

            

            

$this

->resHandler = @

fsockopen

(

$this

->strHost, 

$this

->intPort, &

$this

->intErrorNum, 

&

$this

->strMessage, 

$this

->intConnSecond); 

            

if

 (!

$this

->resHandler) 

            

                

$strErrMsg

 = 'Connection POP3 host: '.

$this

->strHost.' failed'; 

                

$intErrNum

 = 2001; 

                

$this

->setMessage(

$strErrMsg

$intErrNum

); 

                

return

 false; 

            

            

$this

->getLineResponse(); 

            

if

 (!

$this

->getRestIsSucceed()) 

            

                

return

 false; 

            

        

        

return

 true; 

    

}

    

//关闭连接