Set the sender of this message.

@param Address $address

@return self
16229
public function setSender(Address $address): Email
    {
        $this->message->setSender($address->getEmail(), $address->getName());

        return $this;
    }
811591
protected function addAddresses($address, $name, $type)
    {
        if (is_array($address)) {
            $this->swiftMessage->{"set{$type}"}($address, $name);

            return $this;
        }

        $this->swiftMessage->{"add{$type}"}($address, $name);

        return $this;
    }
575923
public function offsetSet($name, $address)
    {
        if (!$address instanceof Address) {
            $address = new Address($address);
        }
        return $this->_data[$address->email()] = $address;
    }
974769
public function setRecipient($address = null, $name = null)
    {
        try {
            $address = $this->idnToAscii($address);

            parent::addAddress($address, $name);

            // copying values as original class does not allow to access recipients array
            $this->_aRecipients[] = [$address, $name];
        } catch (Exception $exception) {
        }
    }
1276887
public function addTo($address, $name = null)
    {
        $address = $this->_addRecipient('To', $address, $name);
        $this->_recipients[$address->email()] = $address;
        return $this;
    }
478674
public static function makeMasternodePauseInstance(string $address): self
    {
        $transaction = new self();

        $transaction->setVersion(Version::MASTERNODE_PAUSE);
        return self::setMasternodeCommandDefaults($address, $transaction);
    }
660517
private function setEmailAddress(?string $emailAddress): self
    {
        $this->updatePropertyValue(
            EmailAddressFieldInterface::PROP_EMAIL_ADDRESS,
            $emailAddress
        );

        return $this;
    }
563712
public function addTo($address, $title = '')
    {
        array_push(
            $this->toAddresses,
            $this->formatEmailAddress($address, $title)
        );

        return $this;
    }
575875
public function setReplyTo($address, $title = '')
    {
        $this->headers['Reply-To'] = $this->formatEmailAddress($address, $title);

        return $this;
    }
1018148
private function setIpAddress(?string $ipAddress): self
    {
        $this->updatePropertyValue(
            IpAddressFieldInterface::PROP_IP_ADDRESS,
            $ipAddress
        );

        return $this;
    }
275658
public function setAddressDestination(\Core\Entity\Address $address_destination = null) {
        $this->address_destination = $address_destination;

        return $this;
    }
42797
public function setFromAddress(string $address, array $variables = []): self
    {
        $this->addRecipient('from', $address, $variables);

        return $this;
    }
1250098
public function addReplyTo($address, $name = null)
    {
        $current = $this->getReplyTo();
        $current[$address] = $name;

        return $this->setReplyTo($current);
    }
685145
public function SetFrom($address, $name = '',$auto=1) {
    $address = trim($address);
    $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
    if (!self::ValidateAddress($address)) {
      $this->SetError($this->Lang('invalid_address').': '. $address);
      if ($this->exceptions) {
        throw new phpmailerException($this->Lang('invalid_address').': '.$address);
      }
      echo $this->Lang('invalid_address').': '.$address;
      return false;
    }
    $this->From = $address;
    $this->FromName = $name;
    if ($auto) {
      if (empty($this->ReplyTo)) {
        $this->AddAnAddress('ReplyTo', $address, $name);
      }
      if (empty($this->Sender)) {
        $this->Sender = $address;
      }
    }
    return true;
  }
531444
public function addAddress($address)
    {
        if (!$this->getAddresses()) {
            return $this->setAddresses(array($address));
        } else {
            return $this->setAddresses(
                array_merge($this->getAddresses(), array($address))
            );
        }
    }
328058
public function connect($address)
    {
        $ret = @socket_connect($this->resource, $this->unformatAddress($address, $port), $port);
        if ($ret === false) {
            throw Exception::createFromSocketResource($this->resource);
        }
        return $this;
    }
716035
public function setReplyToAddress(string $address, array $variables = []): self
    {
        $this->addRecipient('h:reply-to', $address, $variables);

        return $this;
    }