PHPMailer::getSMTPInstance PHP Method

getSMTPInstance() public method

Override this function to load your own SMTP implementation
public getSMTPInstance ( ) : SMTP
return SMTP
    public function getSMTPInstance()
    {
        if (!is_object($this->smtp)) {
            $this->smtp = new SMTP();
        }
        return $this->smtp;
    }

Usage Example

Exemplo n.º 1
0
 public function testBadSMTP()
 {
     $this->Mail->smtpConnect();
     $smtp = $this->Mail->getSMTPInstance();
     $this->assertFalse($smtp->mail("somewhere\nbad"), 'Bad SMTP command containing breaks accepted');
 }
All Usage Examples Of PHPMailer::getSMTPInstance