Sets sender

@param string $sender Name of the sender. The number of characters is limited to 11

@return $this
333044
public function setSender($sender)
    {
        if (!is_null($sender) && (strlen($sender) > 11)) {
            throw new \InvalidArgumentException('invalid length for $sender when calling UpdateSmsCampaign., must be smaller than or equal to 11.');
        }

        $this->container['sender'] = $sender;

        return $this;
    }
1214048
public function setSmsSender($sender)
    {
        $length = strlen($sender);
        $validator = preg_match('/[\w]+/', $sender);
        if ($length < 3 || $length > 13 || !$validator) {
            $message = sprintf("The sms sender %s is invalid", $sender);
            throw new \InvalidArgumentException($message, 500);
        }
        $this->params['sms_sender'] = $sender;
        return $this;
    }
754876
public function sender($address, $name = null)
    {
        $this->swift->setSender($address, $name);

        return $this;
    }
1025550
public function setCharacter($value)
    {
        if ($value !== self::CHARACTER_DEFAULT &&
           $value !== self::CHARACTER_KANSAI &&
           $value !== self::CHARACTER_BABY) {
            throw new DomainError('Invalid character');
        }
        $this->parameters['t'] = $value;
        return $this;
    }
460547
protected function setError($msg)
    {
        $this->error_count++;
        if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {
            $lasterror = $this->smtp->getError();
            if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) {
                $msg .= '<p>' . $this->lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n";
            }
        }
        $this->ErrorInfo = $msg;
    }
201638
public function setSender($email) {
    if (!$this->checkValidEmail($email)) {
      throw new \InvalidArgumentException(
          "Invalid sender: ". htmlspecialchars($email));
    }
    $this->message->setSender($email);
  }
742033
public function setCoreMailSmtpPort($value)
    {
        $this->setFieldName('mail_smtp_port');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
1061438
public function subject($subject)
    {
        try {
            $this->mailer->Subject = $subject;
        } catch (phpmailerException $e) {
            throw new EmailException($e->getMessage(), $e->getCode());
        }

        return $this;
    }
394959
public function setLength($length)
    {
        if (intval($length) < 0) {
            throw new \LengthException(sprintf('Invalid length: %d', $length));
        }

        $this->length = intval($length);

        return $this;
    }
784060
public function setFrom($email, $name = '')
    {
        if (empty($email)) {
            throw new MailerException('email is required for setFrom!');
        }

        if (empty($name)) {
            $name = substr($email, 0, strrpos($email, '@'));
        }

        if (is_null($this->from)) {
            $this->from = [$email, $name];
        } else {
            throw new MailerException('Sender has already been set!');
        }

        return $this;
    }
1218684
public function setCustomer($data = [])
    {
        if (array_key_exists('name', $data)) {
            $this->setCustomerName($data['name']);
        }

        if (array_key_exists('email', $data)) {
            $this->setCustomerEmail($data['email']);
        }

        if (array_key_exists('number', $data)) {
            $this->setCustomerMsisdn($data['number']);
        }

        if (array_key_exists('phone', $data)) {
            $this->setCustomerMsisdn($data['phone']);
        }

        if (array_key_exists('msisdn', $data)) {
            $this->setCustomerMsisdn($data['msisdn']);
        }

        return $this;
    }
174724
public function setText(string $text)
    {
        $this->resource = mailparse_msg_create();
        $eaten = 0;
        $text_length = strlen($text);
        while ($eaten < $text_length) {
            mailparse_msg_parse($this->resource, substr($text, $eaten, 2082));
            $eaten += 2082;
        }

        $this->text = $text;

        return $this;
    }
1238423
public function setNotificationSender($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->notification_sender !== $v) {
            $this->notification_sender = $v;
            $this->modifiedColumns[] = RemoteAppPeer::NOTIFICATION_SENDER;
        }


        return $this;
    }
925890
public function setValidator($validator)
    {
        if (!($validator instanceof AnDomainValidatorAbstract)) {
            if (is_string($validator) && strpos($validator, '.') === false) {
                $identifier = clone $this->getIdentifier();
                $identifier->path = array('domain','validator');
                $identifier->name = $validator;
            } else {
                $identifier = $this->getIdentifier($validator);
            }

            register_default(array('identifier' => $identifier, 'prefix' => $this->_repository->getClone()));

            $validator = $identifier;
        }

        $this->_validator = $validator;

        return $this;
    }
422455
public function setSender($sender)
    {
        if (is_string($sender)) {
            $sender = new Sender($sender);
        } elseif (!$sender instanceof Sender) {
            throw new \InvalidArgumentException('$sender must be a string or an instance of Sender.');
        }

        $this->sender = $sender;

        return $this;
    }
890640
public function setAge($value)
    {
        if ($value === null) {
            $this->parameters['age'] = null;
        } else {
            validators\Number::validate($value, 0, null, 'Invalid age');
            $this->parameters['age'] = max(0, (int)$value);
        }
        return $this;
    }
404165
public function addSender($channel, $sender)
    {
        $sender = is_string($sender) ? singleton($sender) : $sender;
        $this->senders[$channel] = $sender;

        return $this;
    }