Message
class Message implements Arrayable, JsonSerializable, MessageInterface (View source)
Traits
Properties
| protected IMessage|null | $message | The parsed message. |
from HasParsedMessage |
| protected BodyStructureCollection|null | $bodyStructure | The parsed body structure. |
Methods
Get the message's flags.
Add or remove a flag from the message.
Get a header from the message.
Get addresses from the given header.
Determine if the message is empty.
Get the string representation of the message.
Constructor.
Get the names of properties that should be serialized.
Get the message's folder.
Get the message's identifier.
Get the message's size in bytes (RFC822.SIZE).
Get the message's raw headers.
Determine if the message has headers.
Get the message's raw body.
Determine if the message has contents.
Get the message's body structure.
Determine if the message has body structure data.
Copy the message to the given folder.
Move the message to the given folder.
Get the message date and time.
Get the message's message-id.
Get the message's subject.
Get the IN-REPLY-TO message identifier(s).
Get the TO addresses.
Get the CC addresses.
Get the BCC addresses.
Get the message's text content.
Get the message's HTML content.
Get the message's attachments.
Determine if the message has attachments.
Get the count of attachments.
Fetch a specific body part by part number.
Delete the message.
Restore the message.
Get the array representation of the message.
Get the JSON representation of the message.
Fetch the headers from the server.
Fetch the body structure data from the server.
Details
void
markRead()
{@inheritDoc}
void
markUnread()
{@inheritDoc}
void
markSeen()
{@inheritDoc}
void
unmarkSeen()
{@inheritDoc}
void
markAnswered()
{@inheritDoc}
void
unmarkAnswered()
{@inheritDoc}
void
markFlagged()
{@inheritDoc}
void
unmarkFlagged()
{@inheritDoc}
void
markDeleted(bool $expunge = false)
{@inheritDoc}
void
unmarkDeleted()
{@inheritDoc}
void
markDraft()
{@inheritDoc}
void
unmarkDraft()
{@inheritDoc}
void
markRecent()
{@inheritDoc}
void
unmarkRecent()
{@inheritDoc}
bool
isSeen()
{@inheritDoc}
bool
isAnswered()
{@inheritDoc}
bool
isFlagged()
{@inheritDoc}
bool
isDeleted()
{@inheritDoc}
bool
isDraft()
{@inheritDoc}
bool
isRecent()
{@inheritDoc}
bool
hasFlag(BackedEnum|string $flag)
{@inheritDoc}
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.
array
headers()
Get all headers from the message.
IHeader|null
header(string $name, int $offset = 0, bool $fetch = false)
Get a header from the message.
array
addresses(string $header, bool $fetch = false)
Get addresses from the given header.
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, ListData|null $bodyStructureData = null)
Constructor.
array
__sleep()
Get the names of properties that should be serialized.
FolderInterface
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(bool $fetch = false)
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.
BodyStructureCollection|null
bodyStructure(bool $fetch = false)
Get the message's body structure.
bool
hasBodyStructure()
Determine if the message has body structure data.
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.
CarbonInterface|null
date(bool $fetch = false)
Get the message date and time.
string|null
messageId(bool $fetch = false)
Get the message's message-id.
string|null
subject(bool $fetch = false)
Get the message's subject.
Address|null
from(bool $fetch = false)
Get the FROM address.
Address|null
sender(bool $fetch = false)
Get the SENDER address.
Address|null
replyTo(bool $fetch = false)
Get the REPLY-TO address.
array
inReplyTo(bool $fetch = false)
Get the IN-REPLY-TO message identifier(s).
array
to(bool $fetch = false)
Get the TO addresses.
array
cc(bool $fetch = false)
Get the CC addresses.
array
bcc(bool $fetch = false)
Get the BCC addresses.
string|null
text(bool $fetch = false)
Get the message's text content.
string|null
html(bool $fetch = false)
Get the message's HTML content.
array
attachments(bool $fetch = false)
Get the message's attachments.
bool
hasAttachments()
Determine if the message has attachments.
int
attachmentCount()
Get the count of attachments.
string|null
bodyPart(string $partNumber, bool $peek = true)
Fetch a specific body part by part number.
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.
protected string|null
fetchHead()
Fetch the headers from the server.
protected ListData|null
fetchBodyStructureData()
Fetch the body structure data from the server.