亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

給定 [address] 郵箱中的地址不符合 RFC 2822, 3.6.2

給定 [address] 郵箱中的地址不符合 RFC 2822, 3.6.2

PHP
千萬里不及你 2022-12-03 10:56:14
-> 當用戶創建帳戶時,會向他發送一封驗證郵件。這是我的目標。->我正在使用 Laravel,我是新手。->我正確設置了所需的 STMP 詳細信息,如密碼、用戶名、端口、加密->我希望我是清楚的。->在 email.php 中,發件人是:“發件人”=> [“發件人”=> [“地址”=> null,“名稱”=> null],所以我的代碼是:驗證控制器.phpnamespace App\Http\Controllers;use App\User;use Illuminate\Http\Request;class VerifyController extends Controller{    /**     * verify the user with a given token     *      *      */    public function verify($token)        User::where('token', $token)->firstOrFail();            $this->update(['token' => null]); //verify the user            return redirect('/profile');            $this->route('home')            ->with('success', 'Account verifed');    }}用戶.php<?phpnamespace App;use App\User;use Illuminate\Contracts\Auth\MustVerifyEmail;use App\Notifications\VerifyEmail;use Illuminate\Notifications\Notifiable;use Illuminate\Foundation\Auth\User as Authenticatable;class User extends Authenticatable implements MustVerifyEmail{    use Notifiable;    /**     * The attributes that are mass assignable.     *     * @var array     */    protected $fillable = [        'email', 'password', 'token'    ];    /**     * The attributes that should be hidden for arrays.     *     * @var array     */    protected $hidden = [        'password', 'remember_token',    ];    /**     * The attributes that should be cast to native types.     *     * @var array     */    protected $casts = [        'email_verified_at' => 'datetime',    ];    public function orders(){        return $this->hasMany('App\Order');    }    /**     * Returns true if user is verified     * @return bool     *      */    public function verified()    {        return $this->token === null;    }    /**     * Send the user a verification user     * @return void     *      *      *      * */    public function sendVerificationEmail()    {        $this->notify(new VerifyEmail($this));    }}
查看完整描述

1 回答

?
波斯汪

TA貢獻1811條經驗 獲得超4個贊

幾天幾小時后,我意識到 Laravel Frameworks 的版本存在差異。所以問題是我有輸入端口:465,主機:smtp.gmail.com,谷歌給你的應用程序的用戶名和密碼,以及 .env 文件,mail.php,也在config\config.php 中。!我希望對以后有關它的問題有所幫助。



查看完整回答
反對 回復 2022-12-03
  • 1 回答
  • 0 關注
  • 219 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號