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 $sendTo)

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

array
getHeaders()

Get the headers

array
getTo()

Get the list of receivers

string|null
getSubject()

Get the subject of the email

string
getFrom()

Get the sender

string
getMessage()

Get the email message

string
getCharset()

Get the email encoding

string
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 $sendTo)

Define the receiver in list

Parameters

array $sendTo

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

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 getFrom()

Get the sender

Return Value

string

string getMessage()

Get the email message

Return Value

string

string getCharset()

Get the email encoding

Return Value

string

string getType()

Get Content-Type

Return Value

string

bool fromIsDefined()

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

Return Value

bool