yii\mail\BaseMailer::createMessage PHP Method

createMessage() protected method

The newly created instance will be initialized with the configuration specified by [[messageConfig]]. If the configuration does not specify a 'class', the [[messageClass]] will be used as the class of the new message instance.
protected createMessage ( ) : yii\mail\MessageInterface
return yii\mail\MessageInterface message instance.
    protected function createMessage()
    {
        $config = $this->messageConfig;
        if (!array_key_exists('class', $config)) {
            $config['class'] = $this->messageClass;
        }
        $config['mailer'] = $this;
        return Yii::createObject($config);
    }