doutang1884
doutang1884
2016-06-27 14:58

Laravel发送电子邮件,配置和发送脚本

已采纳

I have a problem with my laravel email client. I need to send email by click button.

my code: .env

MAIL_DRIVER=smtp
MAIL_HOST=mail.somedomain.com
MAIL_PORT=587
MAIL_USERNAME=test@somedomain.com
MAIL_PASSWORD=123456
MAIL_ENCRYPTION=null

I think it is good configuration, of course i'm using my domain :)

next in controller I have code like this:

Mail::send('home', array('firstname' => "fname"), function($message){
$message->to("testsend@somedomain.com")->subject('Welcome to the Laravel');
});

Website is open normally but email not send

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答