class Message implements Arrayable, JsonSerializable, MessageInterface (View source)

Traits

Properties

protected IMessage|null $parsed

The parsed message.

from  HasParsedMessage

Methods

void
markRead()

{@inheritDoc}

from  HasFlags
void
markUnread()

{@inheritDoc}

from  HasFlags
void
markSeen()

{@inheritDoc}

from  HasFlags
void
unmarkSeen()

{@inheritDoc}

from  HasFlags
void
markAnswered()

{@inheritDoc}

from  HasFlags
void
unmarkAnswered()

{@inheritDoc}

from  HasFlags
void
markFlagged()

{@inheritDoc}

from  HasFlags
void
unmarkFlagged()

{@inheritDoc}

from  HasFlags
void
markDeleted(bool $expunge = false)

{@inheritDoc}

from  HasFlags
void
unmarkDeleted()

{@inheritDoc}

from  HasFlags
void
markDraft()

{@inheritDoc}

from  HasFlags
void
unmarkDraft()

{@inheritDoc}

from  HasFlags
void
markRecent()

{@inheritDoc}

from  HasFlags
void
unmarkRecent()

{@inheritDoc}

from  HasFlags
bool
isSeen()

{@inheritDoc}

from  HasFlags
bool
isAnswered()

{@inheritDoc}

from  HasFlags
bool
isFlagged()

{@inheritDoc}

from  HasFlags
bool
isDeleted()

{@inheritDoc}

from  HasFlags
bool
isDraft()

{@inheritDoc}

from  HasFlags
bool
isRecent()

{@inheritDoc}

from  HasFlags
bool
hasFlag(BackedEnum|string $flag)

{@inheritDoc}

from  HasFlags
array
flags()

Get the message's flags.

void
flag(BackedEnum|string $flag, string $operation, bool $expunge = false)

Add or remove a flag from the message.

CarbonInterface|null
date()

Get the message date and time.

string|null
messageId()

Get the message's message-id.

string|null
subject()

Get the message's subject.

Address|null
from()

Get the FROM address.

Address|null
sender()

Get the SENDER address.

Address|null
replyTo()

Get the REPLY-TO address.

array
inReplyTo()

Get the IN-REPLY-TO message identifier(s).

array
to()

Get the TO addresses.

array
cc()

Get the CC addresses.

array
bcc()

Get the BCC addresses.

array
attachments()

Get the message's attachments.

bool
hasAttachments()

Determine if the message has attachments.

int
attachmentCount()

Get the count of attachments.

bool
isForwardedMessage(IMessagePart $part)

Determine if the attachment should be treated as an embedded forwarded message.

array
addresses(string $header)

Get addresses from the given header.

string|null
html()

Get the message's HTML content.

string|null
text()

Get the message's text content.

array
headers()

Get all headers from the message.

IHeader|null
header(string $name, int $offset = 0)

Get a header from the message.

IMessage
parse()

Parse the message into a MailMimeMessage instance.

bool
isEmpty()

Determine if the message is empty.

string
__toString()

Get the string representation of the message.

__construct(FolderInterface $folder, int $uid, array $flags, string $head, string $body, int|null $size = null)

Constructor.

array
__sleep()

Get the names of properties that should be serialized.

folder()

Get the message's folder.

int
uid()

Get the message's identifier.

int|null
size()

Get the message's size in bytes (RFC822.SIZE).

string
head()

Get the message's raw headers.

bool
hasHead()

Determine if the message has headers.

string
body()

Get the message's raw body.

bool
hasBody()

Determine if the message has contents.

bool
is(MessageInterface $message)

Determine if the message is the same as another message.

int|null
copy(string $folder)

Copy the message to the given folder.

int|null
move(string $folder, bool $expunge = false)

Move the message to the given folder.

void
delete(bool $expunge = false)

Delete the message.

void
restore()

Restore the message.

array
toArray()

Get the array representation of the message.

array
jsonSerialize()

Get the JSON representation of the message.

Details

void markRead()

{@inheritDoc}

Return Value

void

void markUnread()

{@inheritDoc}

Return Value

void

void markSeen()

{@inheritDoc}

Return Value

void

void unmarkSeen()

{@inheritDoc}

Return Value

void

void markAnswered()

{@inheritDoc}

Return Value

void

void unmarkAnswered()

{@inheritDoc}

Return Value

void

void markFlagged()

{@inheritDoc}

Return Value

void

void unmarkFlagged()

{@inheritDoc}

Return Value

void

void markDeleted(bool $expunge = false)

{@inheritDoc}

Parameters

bool $expunge

Return Value

void

void unmarkDeleted()

{@inheritDoc}

Return Value

void

void markDraft()

{@inheritDoc}

Return Value

void

void unmarkDraft()

{@inheritDoc}

Return Value

void

void markRecent()

{@inheritDoc}

Return Value

void

void unmarkRecent()

{@inheritDoc}

Return Value

void

bool isSeen()

{@inheritDoc}

Return Value

bool

bool isAnswered()

{@inheritDoc}

Return Value

bool

bool isFlagged()

{@inheritDoc}

Return Value

bool

bool isDeleted()

{@inheritDoc}

Return Value

bool

bool isDraft()

{@inheritDoc}

Return Value

bool

bool isRecent()

{@inheritDoc}

Return Value

bool

bool hasFlag(BackedEnum|string $flag)

{@inheritDoc}

Parameters

BackedEnum|string $flag

Return Value

bool

array flags()

Get the message's flags.

Return Value

array

void flag(BackedEnum|string $flag, string $operation, bool $expunge = false)

Add or remove a flag from the message.

Parameters

BackedEnum|string $flag
string $operation
bool $expunge

Return Value

void

CarbonInterface|null date()

Get the message date and time.

Return Value

CarbonInterface|null

string|null messageId()

Get the message's message-id.

Return Value

string|null

string|null subject()

Get the message's subject.

Return Value

string|null

Address|null from()

Get the FROM address.

Return Value

Address|null

Address|null sender()

Get the SENDER address.

Return Value

Address|null

Address|null replyTo()

Get the REPLY-TO address.

Return Value

Address|null

array inReplyTo()

Get the IN-REPLY-TO message identifier(s).

Return Value

array

array to()

Get the TO addresses.

Return Value

array

array cc()

Get the CC addresses.

Return Value

array

array bcc()

Get the BCC addresses.

Return Value

array

array attachments()

Get the message's attachments.

Return Value

array

bool hasAttachments()

Determine if the message has attachments.

Return Value

bool

int attachmentCount()

Get the count of attachments.

Return Value

int

protected bool isForwardedMessage(IMessagePart $part)

Determine if the attachment should be treated as an embedded forwarded message.

Parameters

IMessagePart $part

Return Value

bool

array addresses(string $header)

Get addresses from the given header.

Parameters

string $header

Return Value

array

string|null html()

Get the message's HTML content.

Return Value

string|null

string|null text()

Get the message's text content.

Return Value

string|null

array headers()

Get all headers from the message.

Return Value

array

IHeader|null header(string $name, int $offset = 0)

Get a header from the message.

Parameters

string $name
int $offset

Return Value

IHeader|null

IMessage parse()

Parse the message into a MailMimeMessage instance.

Return Value

IMessage

protected bool isEmpty()

Determine if the message is empty.

Return Value

bool

string __toString()

Get the string representation of the message.

Return Value

string

__construct(FolderInterface $folder, int $uid, array $flags, string $head, string $body, int|null $size = null)

Constructor.

Parameters

FolderInterface $folder
int $uid
array $flags
string $head
string $body
int|null $size

array __sleep()

Get the names of properties that should be serialized.

Return Value

array

FolderInterface folder()

Get the message's folder.

Return Value

FolderInterface

int uid()

Get the message's identifier.

Return Value

int

int|null size()

Get the message's size in bytes (RFC822.SIZE).

Return Value

int|null

string head()

Get the message's raw headers.

Return Value

string

bool hasHead()

Determine if the message has headers.

Return Value

bool

string body()

Get the message's raw body.

Return Value

string

bool hasBody()

Determine if the message has contents.

Return Value

bool

bool is(MessageInterface $message)

Determine if the message is the same as another message.

Parameters

MessageInterface $message

Return Value

bool

int|null copy(string $folder)

Copy the message to the given folder.

Parameters

string $folder

Return Value

int|null

int|null move(string $folder, bool $expunge = false)

Move the message to the given folder.

Parameters

string $folder
bool $expunge

Return Value

int|null

Exceptions

ImapCapabilityException

void delete(bool $expunge = false)

Delete the message.

Parameters

bool $expunge

Return Value

void

void restore()

Restore the message.

Return Value

void

array toArray()

Get the array representation of the message.

Return Value

array

array jsonSerialize()

Get the JSON representation of the message.

Return Value

array