Email
extends Message
in package
Tags
Table of Contents
Constants
- PRIORITY_HIGH = 2
- PRIORITY_HIGHEST = 1
- PRIORITY_LOW = 4
- PRIORITY_LOWEST = 5
- PRIORITY_NORMAL = 3
- PRIORITY_MAP = [self::PRIORITY_HIGHEST => 'Highest', self::PRIORITY_HIGH => 'High', self::PRIORITY_NORMAL => 'Normal', self::PRIORITY_LOW => 'Low', self::PRIORITY_LOWEST => 'Lowest']
Properties
- $attachments : mixed
- $body : mixed
- $cachedBody : AbstractPart|null
- $headers : mixed
- $html : mixed
- $htmlCharset : mixed
- $message : iterable<string|int, mixed>|string
- $text : mixed
- $textCharset : mixed
Methods
- __clone() : mixed
- __construct() : mixed
- __serialize() : array<string|int, mixed>
- __unserialize() : void
- addBcc() : $this
- addCc() : $this
- addFrom() : $this
- addReplyTo() : $this
- addTo() : $this
- attach() : $this
- attachFromPath() : $this
- attachPart() : $this
- bcc() : $this
- cc() : $this
- date() : $this
- embed() : $this
- embedFromPath() : $this
- ensureValidity() : mixed
- from() : $this
- generateMessageId() : string
- getAttachments() : array<string|int, mixed>|array<string|int, DataPart>
- getBcc() : array<string|int, Address>
- getBody() : AbstractPart
- getCc() : array<string|int, Address>
- getDate() : DateTimeImmutable|null
- getFrom() : array<string|int, Address>
- getHeaders() : Headers
- getHtmlBody() : resource|string|null
- getHtmlCharset() : string|null
- getPreparedHeaders() : Headers
- getPriority() : int
- Get the priority of this message.
- getReplyTo() : array<string|int, Address>
- getReturnPath() : Address|null
- getSender() : Address|null
- getSubject() : string|null
- getTextBody() : resource|string|null
- getTextCharset() : string|null
- getTo() : array<string|int, Address>
- html() : $this
- priority() : $this
- Sets the priority of this message.
- replyTo() : $this
- returnPath() : $this
- sender() : $this
- setBody() : $this
- setHeaders() : $this
- subject() : $this
- text() : $this
- to() : $this
- toIterable() : iterable<string|int, mixed>
- toString() : string
- addListAddressHeaderBody() : mixed
- createDataPart() : DataPart
- generateBody() : AbstractPart
- Generates an AbstractPart based on the raw body of a message.
- prepareParts() : array<string|int, mixed>|null
- setHeaderBody() : $this
- setListAddressHeaderBody() : $this
Constants
PRIORITY_HIGH
public
mixed
PRIORITY_HIGH
= 2
PRIORITY_HIGHEST
public
mixed
PRIORITY_HIGHEST
= 1
PRIORITY_LOW
public
mixed
PRIORITY_LOW
= 4
PRIORITY_LOWEST
public
mixed
PRIORITY_LOWEST
= 5
PRIORITY_NORMAL
public
mixed
PRIORITY_NORMAL
= 3
PRIORITY_MAP
private
mixed
PRIORITY_MAP
= [self::PRIORITY_HIGHEST => 'Highest', self::PRIORITY_HIGH => 'High', self::PRIORITY_NORMAL => 'Normal', self::PRIORITY_LOW => 'Low', self::PRIORITY_LOWEST => 'Lowest']
Properties
$attachments
private
mixed
$attachments
= []
$body
private
mixed
$body
$cachedBody
private
AbstractPart|null
$cachedBody
$headers
private
mixed
$headers
$html
private
mixed
$html
$htmlCharset
private
mixed
$htmlCharset
$message
private
iterable<string|int, mixed>|string
$message
$text
private
mixed
$text
$textCharset
private
mixed
$textCharset
Methods
__clone()
public
__clone() : mixed
__construct()
public
__construct([Headers|null $headers = null ][, AbstractPart|null $body = null ]) : mixed
Parameters
- $headers : Headers|null = null
- $body : AbstractPart|null = null
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
addBcc()
public
addBcc(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thisaddCc()
public
addCc(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thisaddFrom()
public
addFrom(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thisaddReplyTo()
public
addReplyTo(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thisaddTo()
public
addTo(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thisattach()
public
attach(resource|string $body[, string|null $name = null ][, string|null $contentType = null ]) : $this
Parameters
- $body : resource|string
- $name : string|null = null
- $contentType : string|null = null
Return values
$thisattachFromPath()
public
attachFromPath(string $path[, string|null $name = null ][, string|null $contentType = null ]) : $this
Parameters
- $path : string
- $name : string|null = null
- $contentType : string|null = null
Return values
$thisattachPart()
public
attachPart(DataPart $part) : $this
Parameters
- $part : DataPart
Return values
$thisbcc()
public
bcc(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thiscc()
public
cc(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thisdate()
public
date(DateTimeInterface $dateTime) : $this
Parameters
- $dateTime : DateTimeInterface
Return values
$thisembed()
public
embed(resource|string $body[, string|null $name = null ][, string|null $contentType = null ]) : $this
Parameters
- $body : resource|string
- $name : string|null = null
- $contentType : string|null = null
Return values
$thisembedFromPath()
public
embedFromPath(string $path[, string|null $name = null ][, string|null $contentType = null ]) : $this
Parameters
- $path : string
- $name : string|null = null
- $contentType : string|null = null
Return values
$thisensureValidity()
public
ensureValidity() : mixed
from()
public
from(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thisgenerateMessageId()
public
generateMessageId() : string
Return values
stringgetAttachments()
public
getAttachments() : array<string|int, mixed>|array<string|int, DataPart>
Return values
array<string|int, mixed>|array<string|int, DataPart>getBcc()
public
getBcc() : array<string|int, Address>
Return values
array<string|int, Address>getBody()
public
getBody() : AbstractPart
Return values
AbstractPartgetCc()
public
getCc() : array<string|int, Address>
Return values
array<string|int, Address>getDate()
public
getDate() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetFrom()
public
getFrom() : array<string|int, Address>
Return values
array<string|int, Address>getHeaders()
public
getHeaders() : Headers
Return values
HeadersgetHtmlBody()
public
getHtmlBody() : resource|string|null
Return values
resource|string|nullgetHtmlCharset()
public
getHtmlCharset() : string|null
Return values
string|nullgetPreparedHeaders()
public
getPreparedHeaders() : Headers
Return values
HeadersgetPriority()
Get the priority of this message.
public
getPriority() : int
The returned value is an integer where 1 is the highest priority and 5 is the lowest.
Return values
intgetReplyTo()
public
getReplyTo() : array<string|int, Address>
Return values
array<string|int, Address>getReturnPath()
public
getReturnPath() : Address|null
Return values
Address|nullgetSender()
public
getSender() : Address|null
Return values
Address|nullgetSubject()
public
getSubject() : string|null
Return values
string|nullgetTextBody()
public
getTextBody() : resource|string|null
Return values
resource|string|nullgetTextCharset()
public
getTextCharset() : string|null
Return values
string|nullgetTo()
public
getTo() : array<string|int, Address>
Return values
array<string|int, Address>html()
public
html(resource|string|null $body[, string $charset = 'utf-8' ]) : $this
Parameters
- $body : resource|string|null
- $charset : string = 'utf-8'
Return values
$thispriority()
Sets the priority of this message.
public
priority(int $priority) : $this
The value is an integer where 1 is the highest priority and 5 is the lowest.
Parameters
- $priority : int
Return values
$thisreplyTo()
public
replyTo(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thisreturnPath()
public
returnPath(Address|string $address) : $this
Parameters
- $address : Address|string
Return values
$thissender()
public
sender(Address|string $address) : $this
Parameters
- $address : Address|string
Return values
$thissetBody()
public
setBody([AbstractPart|null $body = null ]) : $this
Parameters
- $body : AbstractPart|null = null
Return values
$thissetHeaders()
public
setHeaders(Headers $headers) : $this
Parameters
- $headers : Headers
Return values
$thissubject()
public
subject(string $subject) : $this
Parameters
- $subject : string
Return values
$thistext()
public
text(resource|string|null $body[, string $charset = 'utf-8' ]) : $this
Parameters
- $body : resource|string|null
- $charset : string = 'utf-8'
Return values
$thisto()
public
to(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$thistoIterable()
public
toIterable() : iterable<string|int, mixed>
Return values
iterable<string|int, mixed>toString()
public
toString() : string
Return values
stringaddListAddressHeaderBody()
private
addListAddressHeaderBody(string $name, array<string|int, mixed> $addresses) : mixed
Parameters
- $name : string
- $addresses : array<string|int, mixed>
createDataPart()
private
createDataPart(array<string|int, mixed> $attachment) : DataPart
Parameters
- $attachment : array<string|int, mixed>
Return values
DataPartgenerateBody()
Generates an AbstractPart based on the raw body of a message.
private
generateBody() : AbstractPart
The most "complex" part generated by this method is when there is text and HTML bodies with related images for the HTML part and some attachments:
multipart/mixed | |------------> multipart/related | | | |------------> multipart/alternative | | | | | ------------> text/plain (with content) | | | | | ------------> text/html (with content) | | | ------------> image/png (with content) | ------------> application/pdf (with content)
Return values
AbstractPartprepareParts()
private
prepareParts() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullsetHeaderBody()
private
setHeaderBody(string $type, string $name, mixed $body) : $this
Parameters
- $type : string
- $name : string
- $body : mixed
Return values
$thissetListAddressHeaderBody()
private
setListAddressHeaderBody(string $name, array<string|int, mixed> $addresses) : $this
Parameters
- $name : string
- $addresses : array<string|int, mixed>