| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace App\Mail;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Mail\Mailable;
- use Illuminate\Queue\SerializesModels;
- class MsgMail extends Mailable
- {
- use Queueable, SerializesModels;
- protected $aToUsers;
- /**
- * Create a new message instance.
- *
- * @return void
- */
- public function __construct($aToUsers)
- {
- $this->aToUsers = $aToUsers;
- }
- /**
- * Build the message.
- *
- * @return $this
- */
- public function build()
- {
- // 收件人
- $this->to($this->aToUsers);
- // 抄送人
- $this->cc(['411693135@qq.com']);
- // 密送人
- $this->bcc(['411693135@qq.com']);
- // 附件 使用绝对路径
- // $this->attach('D:\phpstudy_pro\WWW\video_system\public\1.docx');
- /**
- * storage 路径添加附件
- * 默认 storage/app 路径前缀,补足后面的路径即可
- * 前缀具体看 app/config/filesystems.php 中 local.root 的配置
- */
- $this->attachFromStorage('public/2.docx');
- return $this->view('mail-msg');
- }
- }
|