- $attach=storage_path("test.txt");
- $to = 'xxxxx@qq.com';
- Mail::send('emails.notice',['name'=>''],function($message) use ($to, $attach) {
- $message ->to($to)->subject('邮件测试');
- if(is_file($attach)){
- $message->attach(storage_path("test.txt"), ['as' => '内容结果.txt']);
- }
- });