Sets the sender.
@param string $sender Sending name or phone number.
@return void
324592
public function setSender(string  $sender): void
    {

        if (preg_match("/^\+?[0-9]+$/m", $sender) && strlen($sender) > 18) {
            trigger_error(
                "Sender number too long, max length is 18 digits",
                E_USER_WARNING
            );
        } elseif (preg_match("/[a-zA-Z]+/m", $sender) && strlen($sender) > 11) {
            trigger_error(
                "Sender string too long, non numeric senders have max length of 11 characters.",
                E_USER_WARNING
            );
        }
        // We do not truncate the sender as the API will do that and the developer might request the sender string back.
        $this->from = $sender;
    }
1330929
public function set(string $name, string $value): void
    {
        $key = strtolower($name);
        $this->headers[$key] = [$name, $value];
    }
937063
protected function sendHeader(string $header, string $content): void
    {
        if (!headers_sent() && self::$sendHeaders) {
            header(sprintf('%s: %s', $header, $content));
        }
    }
150377
public function setGlobalSendAt($send_at)
    {
        if (!($send_at instanceof SendAt)) {
            $send_at = new SendAt($send_at);
        }
        $this->send_at = $send_at;
    }
710807
public function sendMail(Mail $mail) {
		$sender = $mail->getSender();
		if (!$sender instanceof MailAddress) {
			throw new SmtpException('no sender found on mail');
		}
		$this->mail($sender->getEmail());
		
		foreach ($mail->getRecipients() as $address) {
			$address instanceof MailAddress;
			// @todo: catch errors
			$this->recipient($address->getEmail());
		}
		
		$this->data($mail->getData());
	}
538859
public function setLogger(LoggerInterface $logger)
	{
		$this->logger = $logger;

		// Also update the logger of the sender
		if ($this->sender instanceOf LoggerAwareInterface) {
			$this->sender->setLogger($logger);
		}
	}
688219
public function setMessage($value)
    {
        $this->_validateNotNull('Message', $value);
        $this->_validateString('Message', $value);

        if ($this->data['message'] === $value) {
            return;
        }

        $this->data['message'] = $value;

        $this->_setModified('message');
    }
496004
public function set($key, $value) {
        $key = $this->formatKey($key);
        array_set($this->headers, $key, [$value]);
    }
1202215
public static function setLoader($loader) {
    if (!$loader) {
      self::$_loader = NULL;
      return;
    }
    if ($loader instanceof FluentDOM\Loadable) {
      self::$_loader = $loader;
      return;
    }
    throw new FluentDOM\Exceptions\InvalidArgument(
      'loader', [Loadable::class]
    );
  }
470370
public function setSubject($subject = '')
    {
        $this->subject = $subject;
        $this->debug->debug(__FUNCTION__, 'setSubject: ', $this->subject);
    }
1072058
public function setContacts($contacts)
    {
        if (!empty($this->contacts)) {
            $this->contacts += $contacts;
        } else {
            $this->contacts[] = $contacts;
        }
    }
631672
public function setProvider( $provider )
	{
		if ( $provider == $this->getProvider() ) { return; }

		$this->_values['provider'] = (string) $provider;
		$this->setModified();
	}
607295
public function setEmail($email)
    {
        $validator = new EmailValidator();
        if ($validator->validate($email)) {
            $this->_email = $email;
        } else {
            $this->_email = false;
        }
    }
1057496
public function set($key, $value)
    {
        if (!$value instanceof Contact) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s only accepts instances of %s. Tried to to set key %s.',
                    __FUNCTION__, Contact::class, $key
                )
            );
        }

        parent::set($key, $value);
    }
776750
protected function _setTokenEnd($delimiter)
    {
        if (!is_null($delimiter)) {
            $delimiter = $this->_normalizeTokenDelimiter($delimiter);
        }

        $this->tokenEnd = $delimiter;
    }
17345
public function setType($type = self::TYPE_TEXT) {
		if (!in_array($type, array(self::TYPE_TEXT, self::TYPE_HTML))) {
			throw new MailException('invalid type: ' . $type);
		}
		$this->type = $type;
	}
404165
public function addSender($channel, $sender)
    {
        $sender = is_string($sender) ? singleton($sender) : $sender;
        $this->senders[$channel] = $sender;

        return $this;
    }