I
I
Igor Vasiliev2018-11-02 17:38:46
Yii
Igor Vasiliev, 2018-11-02 17:38:46

Yii setFrom() strips spaces how to fix?

Hello.
--
Here is the function that sends emails.

public function sendEmail($email)
    {
        if ($this->validate()) {
            return Yii::$app->mailer->compose(['html' => 'friend'], ['user' => $this, 'token' => Yii::$app->user->identity->nik])
            ->setTo($email)
            ->setFrom([Yii::$app->user->identity->email => $this->user])
            ->setSubject(Defina::my.' - Приглашение от '.self::Sender($this->user))
            ->send(); return true;
        }
        return false;        
    }

Everything works fine, but the name and surname stick together.
5bdc5fcf701d6794288466.png
I cannot understand why this is happening. I inserted a special html character, but it is displayed as characters and not as a space.
There is a suspicion that the setFrom() function does this.
How can I influence this, what interferes?
Otherwise, the name and surname stand works fine, without sticking together.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question