06.10.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Mail 401<br />

1 $message->from($address, $name = null);<br />

2 $message->sender($address, $name = null);<br />

3 $message->to($address, $name = null);<br />

4 $message->cc($address, $name = null);<br />

5 $message->bcc($address, $name = null);<br />

6 $message->replyTo($address, $name = null);<br />

7 $message->subject($subject);<br />

8 $message->priority($level);<br />

9 $message->attach($pathToFile, array $options = []);<br />

10<br />

11 // Attach a file from a raw $data string...<br />

12 $message->attachData($data, $name, array $options = []);<br />

13<br />

14 // Get the underlying SwiftMailer message instance...<br />

15 $message->getSwiftMessage();<br />

Note: The message instance passed to a Mail::send Closure extends the SwiftMailer<br />

message class, allowing you to call any method on that class to build your e-mail messages.<br />

Mailing Plain Text<br />

By default, the view given to the send method is assumed to contain HTML. However, by passing<br />

an array as the first argument to the send method, you may specify a plain text view to send in<br />

addition to the HTML view:<br />

1 Mail::send(['html.view', 'text.view'], $data, $callback);<br />

Or, if you only need to send a plain text e-mail, you may specify this using the text key in the array:<br />

1 Mail::send(['text' => 'view'], $data, $callback);<br />

Mailing Raw Strings<br />

You may use the raw method if you wish to e-mail a raw string directly:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!