PHPMailer\PHPMailer\PHPMailer::isSMTP PHP Method

isSMTP() public method

Send messages using SMTP.
public isSMTP ( ) : void
return void
    public function isSMTP()
    {
        $this->Mailer = 'smtp';
    }

Usage Example

 private function setOptions()
 {
     $this->mailClient->isSMTP();
     $this->mailClient->SMTPAuth = true;
     $this->mailClient->SMTPSecure = 'tls';
     // Enable TLS encryption, `ssl` also accepted
     $this->mailClient->addAddress($this->options->getFrom());
     $this->mailClient->Host = $this->options->getHost();
     $this->mailClient->Username = $this->options->getUserName();
     $this->mailClient->Password = $this->options->getPassword();
     $this->mailClient->setFrom($this->options->getFrom());
     $this->mailClient->Port = $this->options->getPort();
     $this->addCCs();
 }
All Usage Examples Of PHPMailer\PHPMailer\PHPMailer::isSMTP