class Illuminate / Mail / Mailer
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

Mailer

Implements

Uses

Properties

protected

$name string

The name that is configured for the mailer.

Default: null
protected

$views Factory

The view factory instance.

Default: null
protected

$transport Symfony\...\TransportInterface

The Symfony Transport instance.

Default: null
protected

$events Dispatcher |null

The event dispatcher instance.

Default: null
protected

$from array

The global from address and name.

Default: null
protected

$replyTo array

The global reply-to address and name.

Default: null
protected

$returnPath array

The global return path address.

Default: null
protected

$to array

The global to address and name.

Default: null
protected

$queue Factory

The queue factory implementation.

Default: null

Methods

public

__construct ( string $name , Factory $views , Symfony\...\TransportInterface $transport , Dispatcher $events ) : void

Create a new Mailer instance.

Parameters

  • $name string
  • $views Factory
  • $transport Symfony\...\TransportInterface
  • $events Dispatcher |null
public

alwaysFrom ( $address , $name ) : void

Set the global from address and name.

Parameters

  • $address string
  • $name string|null
public

alwaysReplyTo ( $address , $name ) : void

Set the global reply-to address and name.

Parameters

  • $address string
  • $name string|null
public

alwaysReturnPath ( $address ) : void

Set the global return path address.

Parameters

  • $address string
public

alwaysTo ( $address , $name ) : void

Set the global to address and name.

Parameters

  • $address string
  • $name string|null
public

to ( $users , $name ) : PendingMail

Begin the process of mailing a mailable class instance.

Parameters

  • $users mixed
  • $name string|null
public

cc ( $users , $name ) : PendingMail

Begin the process of mailing a mailable class instance.

Parameters

  • $users mixed
  • $name string|null
public

bcc ( $users , $name ) : PendingMail

Begin the process of mailing a mailable class instance.

Parameters

  • $users mixed
  • $name string|null
public

html ( $html , $callback ) : SentMessage |null

Send a new message with only an HTML part.

Parameters

  • $html string
  • $callback mixed
public

raw ( $text , $callback ) : SentMessage |null

Send a new message with only a raw text part.

Parameters

  • $text string
  • $callback mixed
public

plain ( $view , array $data , $callback ) : SentMessage |null

Send a new message with only a plain part.

Parameters

  • $view string
  • $data array
  • $callback mixed
public

render ( $view , array $data ) : string

Render the given message as a view.

Parameters

  • $view string|array
  • $data array
public

send ( $view , array $data , $callback ) : SentMessage |null

Send a new message using a view.

Parameters

protected

sendMailable ( Mailable $mailable ) : SentMessage |null

Send the given mailable.

Parameters

protected

parseView ( $view ) : array

Parse the given view name or array.

Parameters

protected

addContent ( $message , $view , $plain , $raw , $data ) : void

Add the content to a given message.

Parameters

  • $message Message
  • $view string
  • $plain string
  • $raw string
  • $data array
protected

renderView ( $view , $data ) : string

Render the given view.

Parameters

protected

setGlobalToAndRemoveCcAndBcc ( $message ) : void

Set the global "to" address on the given message.

Parameters

public

queue ( $view , $queue ) : mixed

Queue a new e-mail message for sending.

Parameters

  • $view Mailable |string|array
  • $queue string|null
public

onQueue ( $queue , $view ) : mixed

Queue a new e-mail message for sending on the given queue.

Parameters

public

queueOn ( $queue , $view ) : mixed

Queue a new e-mail message for sending on the given queue.

Parameters

public

later ( $delay , $view , $queue ) : mixed

Queue a new e-mail message for sending after (n) seconds.

Parameters

public

laterOn ( $queue , $delay , $view ) : mixed

Queue a new e-mail message for sending after (n) seconds on the given queue.

Parameters

protected

createMessage ( ) : Message

Create a new message instance.

protected

sendSymfonyMessage ( Symfony\...\Email $message ) : Symfony\...\SentMessage|null

Send a Symfony Email instance.

Parameters

  • $message Symfony\...\Email
protected

shouldSendMessage ( $message , $data ) : bool

Determines if the email can be sent.

Parameters

  • $message Symfony\...\Email
  • $data array
protected

dispatchSentEvent ( $message , $data ) : void

Dispatch the message sent event.

Parameters

public

getSymfonyTransport ( ) : Symfony\...\TransportInterface

Get the Symfony Transport instance.

public

getViewFactory ( ) : Factory

Get the view factory instance.

public

setSymfonyTransport ( Symfony\...\TransportInterface $transport ) : void

Set the Symfony Transport instance.

Parameters

  • $transport Symfony\...\TransportInterface
public

setQueue ( Factory $queue ) : $this

Set the queue manager instance.

Parameters