我希望向每位新注册用户发送一封验证电子邮件,并且已经执行了[Laravel文档] [1]中的步骤。
下面是我的User Class
<?php
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Passport\HasApiTokens;
//class User extends Authenticatable
class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens, Notifiable;
protected $guarded = [];
protected $hidden = [
'password', 'remember_token',
];
protected $casts = [
'email_verified_at' => 'datetime',
];
}
web.php路由
<?php
use Illuminate\Support\Facades\Route;
Auth::routes(['verify' => true]);
但是注册后,它将发送结构化的欢迎电子邮件,但不发送验证电子邮件,而是引发以下错误。
Swift_TransportException
Cannot send message without a sender address
我在做什么不正确?