PHPMailer\PHPMailer\PHPMailer::addAddress PHP Method

addAddress() public method

Add a "To" address.
public addAddress ( string $address, string $name = '' ) : boolean
$address string The email address to send to
$name string
return boolean true on success, false if address already used or invalid in some way
    public function addAddress($address, $name = '')
        return $this->addOrEnqueueAnAddress('to', $address, $name);

Usage Example

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