public function actionDownloadMail($file)
    {
        $filePath = Yii::getAlias($this->module->panels['mail']->mailPath) . '/' . basename($file);

        if ((mb_strpos($file, '\\') !== false || mb_strpos($file, '/') !== false) || !is_file($filePath)) {
            throw new NotFoundHttpException('Mail file not found');
        }

        return Yii::$app->response->sendFile($filePath);
    }
public function actionDownloadMail($file)
    {
        $filePath = Yii::getAlias($this->module->panels['mail']->mailPath) . '/' . basename($file);

        if ((mb_strpos($file, '\\') !== false || mb_strpos($file, '/') !== false) || !is_file($filePath)) {
            throw new NotFoundHttpException('Mail file not found');
        }

        return Yii::$app->response->sendFile($filePath);
    }
public function actionDownloadMail ( $ file ) { $ filePath = Yii :: getAlias ( $ this -> module -> panels [ 'mail' ] -> mailPath ) . '/' . basename ( $ file ) ; if ( ( mb_strpos ( $ file , '\\' ) !== false || mb_strpos ( $ file , '/' ) !== false ) || ! is_file ( $ filePath ) ) { throw new NotFoundHttpException ( 'Mail file not found' ) ; } return Yii :: $ app -> response -> sendFile ( $ filePath ) ; }
Download mail action

@param string $file
@return \yii\console\Response|Response
@throws NotFoundHttpException
Download mail action