class Message (View source)

Constants

END

The mail end of line

Methods

__construct(bool $boundary = true)

Message Constructor.

void
setDefaultHeader()

Set the default header

void
addHeader(string $key, string $value)

Add personal headers

to(string $to, string|null $name = null)

Define the receiver

toList(array $recipients)

Define the receiver in list

addFile(string $file)

Add an attachment file

string
compileHeaders()

Compile the mail header

subject(string $subject)

Define the subject of the mail

from(string $from, string|null $name = null)

Define the sender of the mail

html(string $html)

Define the type of content in text/html

text(string $text)

Add message body

addBcc(string $mail, string|null $name = null)

Adds blind carbon copy

addCc(string $mail, string|null $name = null)

Add carbon copy

addReplyTo(string $mail, string|null $name = null)

Add Reply-To

void
setBoundary(string $boundary)

Change the value of the boundary

addReturnPath(string $mail, string|null $name = null)

Add Return-Path

addPriority(int $priority)

Set email priority.

setMessage(string $message, string $type = 'text/html')

Edit the mail message

message(string $message, string $type = 'text/html')

No description

array
getHeaders()

Get the headers

array
getTo()

Get the list of receivers

string|null
getSubject()

Get the subject of the email

string|null
getFrom()

Get the sender

string|null
getMessage()

Get the email message

string|null
getCharset()

Get the email encoding

string|null
getType()

Get Content-Type

bool
fromIsDefined()

Get the value of a variable that verifies that a sender is registered

Details

__construct(bool $boundary = true)

Message Constructor.

Parameters

bool $boundary

void setDefaultHeader()

Set the default header

Return Value

void

void addHeader(string $key, string $value)

Add personal headers

Parameters

string $key
string $value

Return Value

void

Message to(string $to, string|null $name = null)

Define the receiver

Parameters

string $to
string|null $name

Return Value

Message

Message toList(array $recipients)

Define the receiver in list

Parameters

array $recipients

Return Value

Message

Message addFile(string $file)

Add an attachment file

Parameters

string $file

Return Value

Message

Exceptions

MailException

string compileHeaders()

Compile the mail header

Return Value

string

Message subject(string $subject)

Define the subject of the mail

Parameters

string $subject

Return Value

Message

Message from(string $from, string|null $name = null)

Define the sender of the mail

Parameters

string $from
string|null $name

Return Value

Message

Message html(string $html)

Define the type of content in text/html

Parameters

string $html

Return Value

Message

Message text(string $text)

Add message body

Parameters

string $text

Return Value

Message

Message addBcc(string $mail, string|null $name = null)

Adds blind carbon copy

Parameters

string $mail
string|null $name [optional]

Return Value

Message

Message addCc(string $mail, string|null $name = null)

Add carbon copy

Parameters

string $mail
string|null $name [optional]

Return Value

Message

Message addReplyTo(string $mail, string|null $name = null)

Add Reply-To

Parameters

string $mail
string|null $name

Return Value

Message

protected void setBoundary(string $boundary)

Change the value of the boundary

Parameters

string $boundary

Return Value

void

Message addReturnPath(string $mail, string|null $name = null)

Add Return-Path

Parameters

string $mail
string|null $name

= null

Return Value

Message

Message addPriority(int $priority)

Set email priority.

Parameters

int $priority

Return Value

Message

setMessage(string $message, string $type = 'text/html')

Edit the mail message

Parameters

string $message
string $type

message(string $message, string $type = 'text/html')

No description

Parameters

string $message
string $type

See also

setMessage

array getHeaders()

Get the headers

Return Value

array

array getTo()

Get the list of receivers

Return Value

array

string|null getSubject()

Get the subject of the email

Return Value

string|null

string|null getFrom()

Get the sender

Return Value

string|null

string|null getMessage()

Get the email message

Return Value

string|null

string|null getCharset()

Get the email encoding

Return Value

string|null

string|null getType()

Get Content-Type

Return Value

string|null

bool fromIsDefined()

Get the value of a variable that verifies that a sender is registered

Return Value

bool