Email
extends Message
in package
Tags
Table of Contents
- 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']
- $attachments : mixed
- $body : mixed
- $headers : mixed
- $html : mixed
- $htmlCharset : mixed
- $message : mixed
- $text : mixed
- $textCharset : mixed
- __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, 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() : iteratable<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() : mixed
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
$headers
private
mixed
$headers
$html
private
mixed
$html
$htmlCharset
private
mixed
$htmlCharset
$message
private
mixed
$message
$text
private
mixed
$text
$textCharset
private
mixed
$textCharset
Methods
__clone()
public
__clone() : mixed
Return values
mixed —__construct()
public
__construct(iteratable<string|int, mixed>|string $message) : mixed
Parameters
- $message : iteratable<string|int, mixed>|string
Return values
mixed —__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>
Return values
void —addBcc()
public
addBcc(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —addCc()
public
addCc(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —addFrom()
public
addFrom(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —addReplyTo()
public
addReplyTo(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —addTo()
public
addTo(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —attach()
public
attach(resource|string $body[, string $name = null ][, string $contentType = null ]) : $this
Parameters
- $body : resource|string
- $name : string = null
- $contentType : string = null
Return values
$this —attachFromPath()
public
attachFromPath(string $path[, string $name = null ][, string $contentType = null ]) : $this
Parameters
- $path : string
- $name : string = null
- $contentType : string = null
Return values
$this —attachPart()
public
attachPart(DataPart $part) : $this
Parameters
- $part : DataPart
Return values
$this —bcc()
public
bcc(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —cc()
public
cc(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —date()
public
date(DateTimeInterface $dateTime) : $this
Parameters
- $dateTime : DateTimeInterface
Return values
$this —embed()
public
embed(resource|string $body[, string $name = null ][, string $contentType = null ]) : $this
Parameters
- $body : resource|string
- $name : string = null
- $contentType : string = null
Return values
$this —embedFromPath()
public
embedFromPath(string $path[, string $name = null ][, string $contentType = null ]) : $this
Parameters
- $path : string
- $name : string = null
- $contentType : string = null
Return values
$this —ensureValidity()
public
ensureValidity() : mixed
Return values
mixed —from()
public
from(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —generateMessageId()
public
generateMessageId() : string
Return values
string —getAttachments()
public
getAttachments() : array<string|int, DataPart>
Return values
array<string|int, DataPart> —getBcc()
public
getBcc() : array<string|int, Address>
Return values
array<string|int, Address> —getBody()
public
getBody() : AbstractPart
Return values
AbstractPart —getCc()
public
getCc() : array<string|int, Address>
Return values
array<string|int, Address> —getDate()
public
getDate() : DateTimeImmutable|null
Return values
DateTimeImmutable|null —getFrom()
public
getFrom() : array<string|int, Address>
Return values
array<string|int, Address> —getHeaders()
public
getHeaders() : Headers
Return values
Headers —getHtmlBody()
public
getHtmlBody() : resource|string|null
Return values
resource|string|null —getHtmlCharset()
public
getHtmlCharset() : string|null
Return values
string|null —getPreparedHeaders()
public
getPreparedHeaders() : Headers
Return values
Headers —getPriority()
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
int —getReplyTo()
public
getReplyTo() : array<string|int, Address>
Return values
array<string|int, Address> —getReturnPath()
public
getReturnPath() : Address|null
Return values
Address|null —getSender()
public
getSender() : Address|null
Return values
Address|null —getSubject()
public
getSubject() : string|null
Return values
string|null —getTextBody()
public
getTextBody() : resource|string|null
Return values
resource|string|null —getTextCharset()
public
getTextCharset() : string|null
Return values
string|null —getTo()
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
$this —priority()
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
$this —replyTo()
public
replyTo(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —returnPath()
public
returnPath(Address|string $address) : $this
Parameters
- $address : Address|string
Return values
$this —sender()
public
sender(Address|string $address) : $this
Parameters
- $address : Address|string
Return values
$this —setBody()
public
setBody([AbstractPart $body = null ]) : $this
Parameters
- $body : AbstractPart = null
Return values
$this —setHeaders()
public
setHeaders(Headers $headers) : $this
Parameters
- $headers : Headers
Return values
$this —subject()
public
subject(string $subject) : $this
Parameters
- $subject : string
Return values
$this —text()
public
text(resource|string $body[, string $charset = 'utf-8' ]) : $this
Parameters
- $body : resource|string
- $charset : string = 'utf-8'
Return values
$this —to()
public
to(Address|string ...$addresses) : $this
Parameters
- $addresses : Address|string
Return values
$this —toIterable()
public
toIterable() : iteratable<string|int, mixed>
Return values
iteratable<string|int, mixed> —toString()
public
toString() : string
Return values
string —addListAddressHeaderBody()
private
addListAddressHeaderBody(string $name, array<string|int, mixed> $addresses) : mixed
Parameters
- $name : string
- $addresses : array<string|int, mixed>
Return values
mixed —createDataPart()
private
createDataPart(array<string|int, mixed> $attachment) : DataPart
Parameters
- $attachment : array<string|int, mixed>
Return values
DataPart —generateBody()
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
AbstractPart —prepareParts()
private
prepareParts() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —setHeaderBody()
private
setHeaderBody(string $type, string $name, mixed $body) : $this
Parameters
- $type : string
- $name : string
- $body : mixed
Return values
$this —setListAddressHeaderBody()
private
setListAddressHeaderBody(string $name, array<string|int, mixed> $addresses) : mixed
Parameters
- $name : string
- $addresses : array<string|int, mixed>