protected function createMessage() { $config = $this->messageConfig; if (!array_key_exists('class', $config)) { $config['class'] = $this->messageClass; } $config['mailer'] = $this; return Yii::createObject($config); }