The code in main ' mailer ' = [' class ' = ' Yii\swiftmailer\mailer ', ' viewPath ' = ' @common/mail ', ' Usefiletransport ' = False, ' transport ' and ' = ' class ' = ' Swift_smtptransport ', ' ho St ' = ' smtp.163.com ', ' username ' = ' username@163.com ', ' password ' = ' MyPassword ', ' Port ' = ' 994 ', ' encryption ' = ' SSL ',],],passwordresetrequestform inside the code public fun Ction SendEmail () {/* @var $user user */$user = User::findone ([' status ' = = User::status_active, ' Email ' = $this->email,]); if ($user) {if (! User::ispasswordresettokenvalid ($user->password_reset_token)) {$user->generatepasswordresettoken (); if ($user->save ()) {return \yii:: $app->mailer->compose ([' html ' = ' = ' Passwordresettoken -html ', ' text ' = ' passwordresettoken-text '], [' user ' = $user]) ->setfrom ([\yii:: $app->params[' supportemail '] = \yii:: $app->name. ' Robot '])->setto ($this->email)->setsubject (' Password reset for '. \yii:: $app-&G T;name)->send (); }} return false;} Do you have any experience with the great God?
Reply content:
The code in main ' mailer ' = [' class ' = ' Yii\swiftmailer\mailer ', ' viewPath ' = ' @common/mail ', ' Usefiletransport ' = False, ' transport ' and ' = ' class ' = ' Swift_smtptransport ', ' ho St ' = ' smtp.163.com ', ' username ' = ' username@163.com ', ' password ' = ' MyPassword ', ' Port ' = ' 994 ', ' encryption ' = ' SSL ',],],passwordresetrequestform inside the code public fun Ction SendEmail () {/* @var $user user */$user = User::findone ([' status ' = = User::status_active, ' Email ' = $this->email,]); if ($user) {if (! User::ispasswordresettokenvalid ($user->password_reset_token)) {$user->generatepasswordresettoken (); if ($user->save ()) {return \yii:: $app->mailer->compose ([' html ' = ' = ' Passwordresettoken -html ', ' text ' = ' passwordresettoken-text '], [' user ' = $user]) ->setfrom ([\yii:: $app->params[' supportemail '] = \yii:: $app->name. ' Robot '])->setto ($this->email)->setsubject (' Password reset for '. \yii:: $app-&G T;name)->send (); }} return false;} Do you have any experience with the great God?
- Check for error logs
- Are you sure the address of your mail server is configured correctly?