WordPress at a glance
function is not described


PHPMailer::set() public WP 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;.

{} It's a method of the class: PHPMailer{}

No Hooks.


true|false. Nothing.


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

Code of PHPMailer::set() WP 5.7.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;