需要配置激活: https://github.com/fecshop/yii2_fecshop/blob/master/services/email/Customer.php#L30
/**
* 注册账户是否需要邮件激活
*/
public $registerAccountIsNeedEnableByEmail = false;
可以在配置文件中配置这个变量
@common/config/fecshop_local_services/Email.php
return [
'email' => [
'childService' => [
'customer' => [
'registerAccountIsNeedEnableByEmail' => true,
],
],
'mailerConfig' => [
// 默认通用配置
'default' => [
'class' => 'yii\swiftmailer\Mailer',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.qq.com', //SMTP Host
'username' => '2420577683@qq.com', //SMTP 账号
'password' => 'dshagrytvnwjeabb', //SMTP 密码
'port' => '587', //SMTP 端口
'encryption' => 'tls',
],
'messageConfig'=> [
'charset'=> 'UTF-8',
],
],
],
],
];