参考地址http://laravel-china.org/docs/5.0/mail
修改邮件发送配置。在 config/mail.php,修改以下配置:
'host' => 'smtp.163.com',//选择发送邮件的服务器qq,或者163
'port' => 25,//服务器端口号
'from' => array('address' => '***@163.com', 'name' => 'TestMail'),//账号,和发送人的名称
'username' => '***@163.com', // 注意,这里必须和上一行配置里面的邮件地址一致
'password' => '****',//密码(不是账号的密码而是授权码,)
1
$email=$info['user_email'];
$content="用户你好,你的新密码是 $new_pwd 为确保安全,请尽快登陆平台修改密码!!";
$re=Mail::raw($content,function($message)use($email){
$message->to($email)->subject("试试而已");
});
$data = ['email'=>$email, 'name'=>$name, 'uid'=>$uid, 'activationcode'=>$code];
Mail::send('activemail', $data, function($message) use($data)
{
$message->to($data['email'], $data['name'])->subject('欢迎注册我们的网站,请激活您的账号!');
});