내 애플리케이션에서 기본 비밀번호 재설정 알림을 구현하려고하지만 비밀번호 재설정을 시도 할 때 아무런 문제가 발생하지 않고 "Google에 이메일을 발송했습니다. 재설정 링크! " 그러나 내 사서함을 검사하려고 할 때 응용 프로그램에서 전자 메일을 보내지 않았습니다. Laravel 5 비밀번호 재설정 알림이 전송되지 않음
나는 내 응용 프로그램에 필요한 모든 구성했다 : 이메일 드라이버, 데이터베이스 이 최대 설정 그러나 일부 내가 변경 않은 Laravel의 한 부분이 있습니다 : 사용자 모델, 사용자 테이블 마이그레이션테이블 열이 바뀌 었습니다.
ID, 이름, US_EMAIL, 비밀번호, remember_token, created_at, updated_at, EMP_POSITION, 공장, 연락처, 서명, 온라인, DATE_ONLINE, ADMIN, LOCK
나는 재설정 암호에 아무것도하지 않았다 테이블의 모든 필드는 기본 언어 마이그레이션에서 그대로 유지됩니다.
응용 프로그램을 디버그하려고 할 때 응용 프로그램이 "password_resets"테이블에 데이터를 성공적으로 저장할 수 있지만 암호 재설정을 시도 할 때 여전히 전자 메일 재설정 알림을받을 수없는 것 같습니다.
또한이 특성을 보았습니다. "암호 재설정 링크 보내기"를 클릭 한 후 "덤프하고 죽어라"는 시도를했는데 여전히 표시되기 때문에 응용 프로그램이 여전히이 특성으로 진행될 수 있습니다. "dd"메시지.
<?php
namespace Illuminate\Auth\Passwords;
use Illuminate\Auth\Notifications\ResetPassword as ResetPasswordNotification;
trait CanResetPassword
{
/**
* Get the e-mail address where password reset links are sent.
*
* @return string
*/
public function getEmailForPasswordReset()
{
return $this->EMAIL;
}
/**
* Send the password reset notification.
*
* @param string $token
* @return void
*/
public function sendPasswordResetNotification($token)
{
dd('Test SendPasswordNotification');
$this->notify(new ResetPasswordNotification($token));
}
}
나는이에 볼 않았지만 나는 "toMail"기능 "덤프 죽어"할 때이 진행되지 않았다. 아마이 클래스로 진행할 수 없기 때문에 응용 프로그램에서 전자 메일을 보내지 않을 것 같아서 추측하고 있지만 아무에게도 도움이되기를 바랍니다.
<?php
namespace Illuminate\Auth\Notifications;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class ResetPassword extends Notification
{
/**
* The password reset token.
*
* @var string
*/
public $token;
/**
* Create a notification instance.
*
* @param string $token
* @return void
*/
public function __construct($token)
{
$this->token = $token;
}
/**
* Get the notification's channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Build the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
dd('Test ToMail');
return (new MailMessage)
->line('You are receiving this email because we received a password reset request for your account.')
->action('Reset Password', route('password.reset', $this->token))
->line('If you did not request a password reset, no further action is required.');
}
}
업데이트 : 내 .env의 이메일 설정을 사용하여 이메일을 보낼 수 있습니다, 나는 응용 프로그램이 내가 사용하는 전자 메일 서버에 인증 할 수 있다고 생각합니다. 문제는 암호 재설정에 대한 전자 메일 알림을받을 수 없으며 "암호 재설정 링크 보내기"를 클릭 한 후에도 오류를 표시하지 않습니다.
어, 비밀번호가 아닌 메일을 보내려면 일반 제네릭 메일을 보내고 어떻게되는지보십시오. –
안녕하세요, 나는 그것이 진짜로받을 수 없으며 어떤 오류도 표시하지 않기 때문에 재설정되지 않은 이메일을받을 수있는 것 같습니다. 내 유일한 문제는 비밀번호 재설정입니다. –