HumHub Documentation (unofficial)

Email extends Message
in package

Tags
author

Fabien Potencier fabien@symfony.com

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 = []

$htmlCharset

private mixed $htmlCharset

$message

private iterable<string|int, mixed>|string $message

$textCharset

private mixed $textCharset

Methods

__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
$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|null $name = null ][, string|null $contentType = null ]) : $this
Parameters
$body : resource|string
$name : string|null = null
$contentType : string|null = null
Return values
$this

attachFromPath()

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
$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|null $name = null ][, string|null $contentType = null ]) : $this
Parameters
$body : resource|string
$name : string|null = null
$contentType : string|null = null
Return values
$this

embedFromPath()

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
$this

ensureValidity()

public ensureValidity() : 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, mixed>|array<string|int, DataPart>
Return values
array<string|int, mixed>|array<string|int, DataPart>

getDate()

public getDate() : DateTimeImmutable|null
Return values
DateTimeImmutable|null

getHtmlBody()

public getHtmlBody() : resource|string|null
Return values
resource|string|null

getHtmlCharset()

public getHtmlCharset() : string|null
Return values
string|null

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>

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

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

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|null $body[, string $charset = 'utf-8' ]) : $this
Parameters
$body : resource|string|null
$charset : string = 'utf-8'
Return values
$this

to()

public to(Address|string ...$addresses) : $this
Parameters
$addresses : Address|string
Return values
$this

toIterable()

public toIterable() : iterable<string|int, mixed>
Return values
iterable<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>

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) : $this
Parameters
$name : string
$addresses : array<string|int, mixed>
Return values
$this

        
On this page

Search results