1<?php
2
3namespacde App\Mail;
4
5use Illuminate\Bus\Queueable;
6use Illuminate\Mail\Mailable;
7use Illuminate\Queue\SerializesModels;
8use Illuminate\Contracts\Queue\ShouldQueue;
9
10class SendMailWithAttachment extends Mailable implements ShouldQueue
11{
12 use Queueable, SerializesModels;
13
14 /**
15 * Create a new message instance.
16 *
17 * @return void
18 */
19 public function __construct()
20 {
21 //
22 }
23
24 /**
25 * Build the message.
26 *
27 * @return $this
28 */
29 public function build()
30 {
31 return $this->to('test@example.com')
32 ->attach(storage_path('app/1569316022.jpg'))
33 ->markdown('mail_example');
34 }
35}
36
1<?php
2
3namespace App\Mail;
4
5use Illuminate\Bus\Queueable;
6use Illuminate\Mail\Mailable;
7use Illuminate\Queue\SerializesModels;
8use Illuminate\Contracts\Queue\ShouldQueue;
9
10d{
11 use Queueable, SerializesModels;
12
13 /**
14 * Create a new message instance.
15 *
16 * @return void
17 */
18 public function __construct()
19 {
20 //
21 }
22
23 /**
24 * Build the message.
25 *
26 * @return $this
27 */
28 public function build()
29 {
30 return $this->to('test@example.com')
31 ->attach(storage_path('app/1569316022.jpg'))
32 ->markdown('mail_example');
33 }
34}
35