Set message sender.

@param mixed $sender

@return Message
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;
    }
667418
public function setMinMessage($minMessage)
    {
        if (!is_string($minMessage)) {
            throw new \InvalidArgumentException('The attribute minMessage on the class Attribute has to be string (' . gettype($minMessage) . ('object' === gettype($minMessage) ? ' ' . get_class($minMessage) : '') . ' given).');
        }

        $this->minMessage = $minMessage;

        return $this;
    }
50384
public function setMessages(array $messages)
    {
        foreach ($messages as $key => $message) {
            $this->setMessage($message, $key);
        }
        return $this;
    }
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;
    }
1268549
public function setMainMessage(string $message, bool $translate = true) {
        $this->mainMessage = $translate ? $this->translate($message) : $message;
        return $this;
    }
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');
    }
699800
public function set_sender($email)
        {
            $parts = $this->parse_email($email);
            $this->from_user = $parts[0];
            $this->from_domain = $parts[1];
        }
253494
public function setMailSender(\Parable\Mail\Sender\SenderInterface $mailSender)
    {
        $this->mailSender = $mailSender;
        return $this;
    }
359013
public static function fromMessage(Message $msg)
    {
        return new self($msg->shift(), $msg->shift(), $msg->toArray());
    }
1046522
public function setSender(ContactInterface $sender = null)
    {
        if ($sender !== null && !($sender instanceof Contact)) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s expects an instance of %s.',
                    __FUNCTION__, Contact::class
                )
            );
        }
        $this->sender = $sender;

        return $this;
    }
966179
public function sender($address, $name = null)
    {
        $this->swiftMessage->setSender($address, $name);

        return $this;
    }
623428
public function setSender(string $address, ?string $name = null): Message
    {
        $this->sender = [
            'address' => $address,
            'name'    => $name
        ];

        return $this;
    }
1309498
public function setValidator(Validator $validator)
    {
        if ($validator) {
            $this->validator = $validator;
            $this->validator->setForm($this);
        }
        return $this;
    }
754876
public function sender($address, $name = null)
    {
        $this->swift->setSender($address, $name);

        return $this;
    }
820486
public void setMailFromDefault(String sender) {

        m_mailFromDefault = sender;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.LOG_DEFAULT_SENDER_1, m_mailFromDefault));
        }
    }
531498
public function setSenderEmail($senderEmail)
    {
        if ($this->sender == null) {
            $this->sender = new PagSeguroSender();
        }
        $this->sender->setEmail($senderEmail);
    }
909820
public static function from($sender = NULL) {
    if (!isset($sender) && ($sender = Config::get('mail.from')) == NULL) {
      $sender = 'www@'.PSC::getEnvironment()->getHostName();
    }
    return self::recipient($sender);
  }