'new' 'captchaAction' => 'site/captcha' ] ]; } public function getURL(){ return $this->currentURL; } /** * @inheritdoc */ public function attributeLabels() { return array( 'verifyCode' => 'Verify Code', 'name' => 'Name', 'email' => 'Email', 'body' => 'Message', ); } /** * Sends an email to the specified email address using the information collected by this model. * * @param string $email * the target email address * @return boolean whether the email was sent */ public function sendEmail() { $bodytxt=$this->body; $subjecttxt='Feedback from GGBN '.Yii::$app->request->baseUrl; if(!empty($this->subject)) $subjecttxt.=": ".$this->subject; if(!empty($this->email)) $bodytxt.="\n Sent from (email): ".$this->email; if(!empty($this->name)) $bodytxt.="\n Sent from (name): ".$this->name; $bodytxt.="\n IP USED: ".Yii::$app->request->userIP; $bodytxt.="\n test: ".$_POST['website']." test end"; if(!empty($_POST['website'])) { die(); } else { return Yii::$app->mailer->compose() ->setFrom(Yii::$app->params ['noreplyMail']) ->setTo(Yii::$app->params['feedbackMail']) ->setSubject($subjecttxt) ->setTextBody($bodytxt) ->send(); } } }