public function sendEmail()
    {
        $mandrill = new Mandrill(Yii::$app->params['mandrill']['key']);
        $message = [
            'html' => $this->html,
            'text' => $this->text,
            'subject' => $this->subject,
            'from_email' => $this->from_email,
            'from_name' => $this->from_name,
            'track_opens' => true,
            'track_clicks' => true,
            'auto_text' => true,
            'to' => [['email' => $this->to_email, 'name' => $this->to_name]],
            'bcc_address' => 'mihai.petrescu@gmail.com',
        ];
        $result = $mandrill->messages->send($message);
        if ($result[0]['status'] == 'sent') {
            $this->status = 'sent';
        } else {
            $this->tries++;
        }
        $this->save();
    }
public function sendEmail()
    {
        $mandrill = new Mandrill(Yii::$app->params['mandrill']['key']);
        $message = [
            'html' => $this->html,
            'text' => $this->text,
            'subject' => $this->subject,
            'from_email' => $this->from_email,
            'from_name' => $this->from_name,
            'track_opens' => true,
            'track_clicks' => true,
            'auto_text' => true,
            'to' => [['email' => $this->to_email, 'name' => $this->to_name]],
            'bcc_address' => 'mihai.petrescu@gmail.com',
        ];
        $result = $mandrill->messages->send($message);
        if ($result[0]['status'] == 'sent') {
            $this->status = 'sent';
        } else {
            $this->tries++;
        }
        $this->save();
    }
public function sendEmail ( ) { $ mandrill = new Mandrill ( Yii :: $ app -> params [ 'mandrill' ] [ 'key' ] ) ; $ message = [ 'html' => $ this -> html , 'text' => $ this -> text , 'subject' => $ this -> subject , 'from_email' => $ this -> from_email , 'from_name' => $ this -> from_name , 'track_opens' => true , 'track_clicks' => true , 'auto_text' => true , 'to' => [ [ 'email' => $ this -> to_email , 'name' => $ this -> to_name ] ] , 'bcc_address' => 'mihai.petrescu@gmail.com' , ] ; $ result = $ mandrill -> messages -> send ( $ message ) ; if ( $ result [ 0 ] [ 'status' ] == 'sent' ) { $ this -> status = 'sent' ; } else { $ this -> tries ++ ; } $ this -> save ( ) ; }
Tries to send the email to mandril

If it is successful then it updates the email
If it is NOT successful then it updates number of tries

@access  public
Tries to send the email to mandril