PHPMailer\PHPMailer

PHPMailer::set()publicWP 1.0

Set or reset instance properties. You should avoid this function - it's more verbose, less efficient, more error-prone and harder to debug than setting properties directly. Usage Example: $mail->set('SMTPSecure', static::ENCRYPTION_STARTTLS); is the same as: $mail->SMTPSecure = static::ENCRYPTION_STARTTLS;.

Method of the class: PHPMailer{}

No Hooks.

Return

true|false.

Usage

$PHPMailer = new PHPMailer();
$PHPMailer->set( $name, $value );
$name(string) (required)
The property name to set
$value(mixed)
The value to set the property to
Default: ''

PHPMailer::set() code WP 6.5.2

public function set($name, $value = '')
{
    if (property_exists($this, $name)) {
        $this->{$name} = $value;

        return true;
    }
    $this->setError($this->lang('variable_set') . $name);

    return false;
}