Email jo'natishda hatolik

+3 ovoz
80 marta ko‘rilgan
so‘radi 18 iyul, 17 Isakov Samandar (131 bal)
Asslomu alaykum. PHPni mail() funksiyasi orqali emailga link jo'natilayapti shunda
mail(): SMTP server response: 452 4.3.1 Out of memory shunda hatolik berayapti.
izoh qoldirdi 18 iyul, 17 Sardor Dushamov (1,593 bal)
linksiz email boryaptimi?
izoh qoldirdi 18 iyul, 17 Isakov Samandar (131 bal)
yo'q umuman hech narsa bormayatpi
izoh qoldirdi 18 iyul, 17 Sardor Dushamov (1,593 bal)
shuni qilib kordizmi
izoh qoldirdi 18 iyul, 17 Isakov Samandar (131 bal)
ha lekin foydasi bo'lmadi

1 ta javob

0 ovoz
javob berdi 12 yanvar user_best (125 bal)
ko‘rsatildi 13 yanvar Saidolim
public function actionCreate()
    {
        $request = Yii::$app->request;
        $model = new Users();  

        if($request->isAjax){
            Yii::$app->response->format = Response::FORMAT_JSON;
            if($request->isGet){
                return [
                    'title'=> "Yangi foydalanuvchi qo'shish",
                    'size' => 'normal',
                    'content'=>$this->renderAjax('create', [
                        'model' => $model,
                    ]),
                    'footer'=> Html::button('Yopish',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                                Html::button('Saqlash',['class'=>'btn btn-primary','type'=>"submit"])
                ];         
            }else if($model->load($request->post())&& $model->validate()){
                if($model->permission==3){
                    $model->district_id = null;
                    $model->school = null;
                }
                if($model->permission==4){
                    $model->school = null;
                }
                $newPassword = str_pad(rand(0, 99999), 5, '0', STR_PAD_LEFT);
                $model->parol = md5($newPassword);

                try{
                    Yii::$app->mailer->compose()
                           ->setFrom('mockuprltest@gmail.com')
                           ->setTo($model->login)
                           ->setSubject('Avtorizatsiyadan o\'tish')
                           ->setHtmlBody('Tizimga kirish uchun quyidagi ssilkaga kiring : http://'. $_SERVER['SERVER_NAME'] .'/site/login. <br> Sizning loginingiz : '. $model->login .' , vaqtinchalik parolingiz : ' . $newPassword)
                           ->send();
                } catch (\Exception $e){
                        return [
                    'forceReload'=>'#crud-datatable-pjax',
                    'title'=> "Yangi foydalanuvchi qo'shish",
                    'size' => 'normal',
                    'content'=>$this->renderAjax('error', [
                        'e' => $e,
                    ]),
                    'footer'=> Html::button('Yopish',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                            Html::a('Yana qo\'shish',['create'],['class'=>'btn btn-primary','role'=>'modal-remote'])
                ];         
                }
                $model->save();
                return [
                    'forceReload'=>'#crud-datatable-pjax',
                    'title'=> "Yangi foydalanuvchi qo'shish",
                    'size' => 'normal',
                    'content'=>'<span class="text-success">Muvaffaqiyatli bajarildi</span>',
                    'footer'=> Html::button('Yopish',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                            Html::a('Yana qo\'shish',['create'],['class'=>'btn btn-primary','role'=>'modal-remote'])
                ];         
            }else{           
                return [
                    'title'=> "Yangi foydalanuvchi qo'shish",
                    'size' => 'normal',
                    'content'=>$this->renderAjax('create', [
                        'model' => $model,
                    ]),
                    'footer'=> Html::button('Yopish',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                                Html::button('Saqlash',['class'=>'btn btn-primary','type'=>"submit"])
                ];         
            }
        }else{
            if ($model->load($request->post()) && $model->save()) {
                return $this->redirect(['view', 'id' => $model->id]);
            } else {
                return $this->render('create', [
                    'model' => $model,
                ]);
            }
        }
    }
izoh qoldirdi 13 yanvar Saidolim (3,370 bal)
bu nima kod? ishlaydimi?

Assalomu alaykum, yordam.uz saytimizga xush kelibsiz.

Bu saytda o`zingizni qiziqtirgan savollarga javob olishingiz va o`z sohangiz bo`yicha savollarga javob berishingiz mumkin.

Bizning Oilamizga a'zo bo`lganingiz uchun chuqur Minnatdorchilik bildiramiz !!!

Telegram kanal YordamUzRss

...