class Mailer implements Mailer, MailQueue (View source)
| Macroable |
| static protected array | $macros | The registered string macros. | from Macroable |
| protected string | $name | The name that is configured for the mailer. | |
| protected Factory | $views | The view factory instance. | |
| protected TransportInterface | $transport | The Symfony Transport instance. | |
| protected Dispatcher|null | $events | The event dispatcher instance. | |
| protected array | $from | The global from address and name. | |
| protected array | $replyTo | The global reply-to address and name. | |
| protected array | $returnPath | The global return path address. | |
| protected array | $to | The global to address and name. | |
| protected Factory | $queue | The queue factory implementation. |
| static void | macro(string $name, object|callable $macro)
Register a custom macro. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Mix another object into the class. | from Macroable |
| static bool | hasMacro(string $name)
Checks if macro is registered. | from Macroable |
| static void | flushMacros()
Flush the existing macros. | from Macroable |
| static mixed | __callStatic(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| mixed | __call(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| void | __construct(string $name, Factory $views, TransportInterface $transport, Dispatcher|null $events = null)
Create a new Mailer instance. | |
| void | alwaysFrom(string $address, string|null $name = null)
Set the global from address and name. | |
| void | alwaysReplyTo(string $address, string|null $name = null)
Set the global reply-to address and name. | |
| void | alwaysReturnPath(string $address)
Set the global return path address. | |
| void | alwaysTo(string $address, string|null $name = null)
Set the global to address and name. | |
| PendingMail | to(mixed $users, string|null $name = null)
Begin the process of mailing a mailable class instance. | |
| PendingMail | cc(mixed $users, string|null $name = null)
Begin the process of mailing a mailable class instance. | |
| PendingMail | bcc(mixed $users, string|null $name = null)
Begin the process of mailing a mailable class instance. | |
| SentMessage|null | html(string $html, mixed $callback)
Send a new message with only an HTML part. | |
| SentMessage|null | raw(string $text, mixed $callback)
Send a new message with only a raw text part. | |
| SentMessage|null | plain(string $view, array $data, mixed $callback)
Send a new message with only a plain part. | |
| string | render(string|array $view, array $data = [])
Render the given message as a view. | |
| string | replaceEmbeddedAttachments(string $renderedView, array $attachments)
Replace the embedded image attachments with raw, inline image data for browser rendering. | |
| SentMessage|null | send(Mailable|string|array $view, array $data = [], Closure|string|null $callback = null)
Send a new message using a view. | |
| SentMessage|null | sendMailable(Mailable $mailable)
Send the given mailable. | |
| SentMessage|null | sendNow(Mailable|string|array $mailable, array $data = [], Closure|string|null $callback = null)
Send a new message synchronously using a view. | |
| array | parseView(Closure|array|string $view)
Parse the given view name or array. | |
| void | addContent(Message $message, string $view, string $plain, string $raw, array $data)
Add the content to a given message. | |
| string | renderView(Closure|string $view, array $data)
Render the given view. | |
| void | setGlobalToAndRemoveCcAndBcc(Message $message)
Set the global "to" address on the given message. | |
| mixed | queue(Mailable|string|array $view, string|null $queue = null)
Queue a new mail message for sending. | |
| mixed | onQueue(string $queue, Mailable $view)
Queue a new mail message for sending on the given queue. | |
| mixed | queueOn(string $queue, Mailable $view)
Queue a new mail message for sending on the given queue. | |
| mixed | later(DateTimeInterface|DateInterval|int $delay, Mailable|string|array $view, string|null $queue = null)
Queue a new mail message for sending after (n) seconds. | |
| mixed | laterOn(string $queue, DateTimeInterface|DateInterval|int $delay, Mailable $view)
Queue a new mail message for sending after (n) seconds on the given queue. | |
| Message | createMessage()
Create a new message instance. | |
| SentMessage|null | sendSymfonyMessage(Email $message)
Send a Symfony Email instance. | |
| bool | shouldSendMessage(Email $message, array $data = [])
Determines if the email can be sent. | |
| void | dispatchSentEvent(SentMessage $message, array $data = [])
Dispatch the message sent event. | |
| TransportInterface | getSymfonyTransport()
Get the Symfony Transport instance. | |
| Factory | getViewFactory()
Get the view factory instance. | |
| void | setSymfonyTransport(TransportInterface $transport)
Set the Symfony Transport instance. | |
| $this | setQueue(Factory $queue)
Set the queue manager instance. |
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Flush the existing macros.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new Mailer instance.
Set the global from address and name.
Set the global reply-to address and name.
Set the global return path address.
Set the global to address and name.
Begin the process of mailing a mailable class instance.
Begin the process of mailing a mailable class instance.
Begin the process of mailing a mailable class instance.
Send a new message with only an HTML part.
Send a new message with only a raw text part.
Send a new message with only a plain part.
Render the given message as a view.
Replace the embedded image attachments with raw, inline image data for browser rendering.
Send a new message using a view.
Send the given mailable.
Send a new message synchronously using a view.
Parse the given view name or array.
Add the content to a given message.
Render the given view.
Set the global "to" address on the given message.
Queue a new mail message for sending.
Queue a new mail message for sending on the given queue.
Queue a new mail message for sending on the given queue.
This method didn't match rest of framework's "onQueue" phrasing. Added "onQueue".
Queue a new mail message for sending after (n) seconds.
Queue a new mail message for sending after (n) seconds on the given queue.
Create a new message instance.
Send a Symfony Email instance.
Determines if the email can be sent.
Dispatch the message sent event.
Get the Symfony Transport instance.
Get the view factory instance.
Set the Symfony Transport instance.
Set the queue manager instance.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Mail/Mailer.html