我在.env文件中进行了以下设置:
MAIL_DRIVER=smtp
MAIL_HOST=mail.greenfintech.com
MAIL_PORT=25
MAIL_USERNAME=rizwan@greenfintech.com
MAIL_PASSWORD=mypassword (Here I type password for rizwan@greenfintech.com)
MAIL_ENCRYPTION=null
相同的设置在config / mail.php文件中。
代码:
public function register(Request $request) {
$first_name = $request->fname;
$email = $request->email;
$password = $request->password;
$data=compact('first_name','email','password');
$sent = Mail::send('emails.sign-up-alert',$data,function($message) use($email)
{
$message->from('postmaster@mg.webmktgsolutions.com', "Parts-Search");
$message->subject("Brake Project: Welcome to Parts Search");
$message->to($email);
});
// dd(Mail::failures());
}
我正在从localhost(xampp)发送电子邮件。当我发送邮件到rizwan@greenfintech.com时,电子邮件正常,但邮件不会发送到razi.sagittarious @ gmail.com / razi_sagittarious @ yahoo.com ..我还需要设置其他内容还是其他问题?电子邮件只会转到greenfin地址,但不会转到gmail,yahoo等帐户。