简体   繁体   English

Laravel 5.5:未收到密码重置链接邮件

[英]Laravel 5.5 : Not receiving password reset link mail

I am using hostgators/AWS smtp service.我正在使用 hostgators/AWS smtp 服务。 everything is good .一切都很好。 my mail function is working great as i am able to send all my forms data on my website.我的邮件功能运行良好,因为我可以在我的网站上发送所有表单数据。 but when i am trying to reset password (forgot password?) ...when i click send reset link it is showing that link has been sent (please check screenshot ) .. but i am not getting any mail.但是当我尝试重置密码(忘记密码?)...当我点击发送重置链接时,它显示该链接已发送(请查看屏幕截图)...但我没有收到任何邮件。 i have tried to send mails to different registered users but not getting that reset link .我试图向不同的注册用户发送邮件,但没有收到重置链接。 i have created this login system using php artisan make:auth .我使用 php artisan make:auth 创建了这个登录系统。

If I tested with POSTMAN or any API client it is working but once I implemented it with the application it is not working.如果我使用 POSTMAN 或任何 API 客户端进行测试,它可以正常工作,但是一旦我使用应用程序实现它,它就无法工作。

more details will be provided if needed.如果需要,将提供更多详细信息。 在此处输入图片说明

In .env file add new variable called MAIL_FROM_ADDRESS=your_smtp_from_mail_id .在 .env 文件中添加名为MAIL_FROM_ADDRESS=your_smtp_from_mail_id新变量。 you have to set MAIL_FROM_ADDRESS to valid smtp from_mail email id.您必须将 MAIL_FROM_ADDRESS 设置为有效的 smtp from_mail 电子邮件 ID。 sometimes in .env file this variable doesn't exist.有时在 .env 文件中这个变量不存在。 if it is not set manually ;如果不是手动设置; when sending mail it is picking up a default mail id which is hello@example.com .发送邮件时,它会选择一个默认的邮件 ID,即hello@example.com please have look here config/mail.php请看这里 config/mail.php

'from' => [
    'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
    'name' => env('MAIL_FROM_NAME', 'Example'),
],

i think this should work !我认为这应该有效!

This worked for me .这对我有用。

Most likely your problem is from the mail configuration on .env file.您的问题很可能来自 .env 文件上的邮件配置。 Check mail configuration in .env file, also read laravel.log检查 .env 文件中的邮件配置,同时阅读 laravel.log

check your spam.检查您的垃圾邮件。 If your are using localhost then probably the email are in spam folder.如果您使用的是 localhost,那么电子邮件可能位于垃圾邮件文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM