Constants

CRLF

CRLF

CRLF EOL constant

LF

LF

LF EOL constant

Properties

$headers

$headers : array

Mail headers

Type

array

$subject

$subject : string

Subject

Type

string

$params

$params : string

Mail parameters

Type

string

$attachments

$attachments : array

File attachments

Type

array

$group

$group : boolean

Send as group flag

Type

boolean

Methods

__construct()

__construct(string  $subject = null, mixed  $rcpts = null) : \Pop\Mail\Mail

Constructor

Instantiate the mail object

Parameters

string $subject
mixed $rcpts

Returns

\Pop\Mail\Mail

getQueue()

getQueue() : \Pop\Mail\Queue

Get the mail queue

Returns

\Pop\Mail\Queue

getMessage()

getMessage() : \Pop\Mail\Message

Get the mail message

Returns

\Pop\Mail\Message

getHeaders()

getHeaders() : array

Get the mail header

Returns

array

getHeader()

getHeader(string  $name) : string

Get the mail header

Parameters

string $name

Returns

string

getSubject()

getSubject() : string

Get the subject

Returns

string

getBoundary()

getBoundary() : string

Get MIME boundary

Returns

string

getEol()

getEol() : string

Get EOL

Returns

string

getCharset()

getCharset() : string

Get character set

Returns

string

getText()

getText() : string

Get text part of the message

Returns

string

getHtml()

getHtml() : string

Get HTML part of the message

Returns

string

getAttachments()

getAttachments() : array

Get attachments

Returns

array

to()

to(string  $email, string  $name = null) : \Pop\Mail\Mail

Alias to add a recipient to the queue

Parameters

string $email
string $name

Returns

\Pop\Mail\Mail

add()

add(string  $email, string  $name = null) : \Pop\Mail\Mail

Add a recipient to the queue

Parameters

string $email
string $name

Returns

\Pop\Mail\Mail

addRecipients()

addRecipients(mixed  $rcpts) : \Pop\Mail\Mail

Add recipients to the queue

Parameters

mixed $rcpts

Throws

\Pop\Mail\Exception

Returns

\Pop\Mail\Mail

from()

from(string  $email, string  $name = null, boolean  $replyTo = true) : \Pop\Mail\Mail

Alias to set the from and reply-to headers

Parameters

string $email
string $name
boolean $replyTo

Returns

\Pop\Mail\Mail

replyTo()

replyTo(string  $email, string  $name = null, boolean  $from = true) : \Pop\Mail\Mail

Alias to set the reply-to and from headers

Parameters

string $email
string $name
boolean $from

Returns

\Pop\Mail\Mail

cc()

cc(string  $email, string  $name = null) : \Pop\Mail\Mail

Alias to set the cc headers

Parameters

string $email
string $name

Returns

\Pop\Mail\Mail

bcc()

bcc(string  $email, string  $name = null) : \Pop\Mail\Mail

Alias to set the bcc headers

Parameters

string $email
string $name

Returns

\Pop\Mail\Mail

setHeader()

setHeader(string  $name, string  $value) : \Pop\Mail\Mail

Set a mail header

Parameters

string $name
string $value

Returns

\Pop\Mail\Mail

setHeaders()

setHeaders(array  $headers) : \Pop\Mail\Mail

Set mail headers

Parameters

array $headers

Returns

\Pop\Mail\Mail

setSubject()

setSubject(string  $subj) : \Pop\Mail\Mail

Set the subject

Parameters

string $subj

Returns

\Pop\Mail\Mail

setBoundary()

setBoundary(string  $bnd = null) : \Pop\Mail\Mail

Set MIME boundary

Parameters

string $bnd

Returns

\Pop\Mail\Mail

setEol()

setEol(string  $eol = \Pop\Mail\Mail::CRLF) : \Pop\Mail\Mail

Set EOL

Parameters

string $eol

Returns

\Pop\Mail\Mail

setCharset()

setCharset(string  $chr) : \Pop\Mail\Mail

Set character set

Parameters

string $chr

Returns

\Pop\Mail\Mail

setText()

setText(string  $text) : \Pop\Mail\Mail

Set text part of the message.

Parameters

string $text

Returns

\Pop\Mail\Mail

setHtml()

setHtml(string  $html) : \Pop\Mail\Mail

Set HTML part of the message.

Parameters

string $html

Returns

\Pop\Mail\Mail

sendAsGroup()

sendAsGroup(boolean  $group) : \Pop\Mail\Mail

Set the send as group flag

Parameters

boolean $group

Returns

\Pop\Mail\Mail

attachFile()

attachFile(string  $file) : \Pop\Mail\Mail

Attach a file to the mail object.

Parameters

string $file

Throws

\Pop\Mail\Exception

Returns

\Pop\Mail\Mail

setParams()

setParams(mixed  $params = null) : \Pop\Mail\Mail

Set parameters

Parameters

mixed $params

Returns

\Pop\Mail\Mail

send()

send() : void

Send mail message or messages.

This method depends on the server being set up correctly as an SMTP server and sendmail being correctly defined in the php.ini file.

saveTo()

saveTo(string  $to = null, string  $format = null) : \Pop\Mail\Mail

Save mail message or messages in a folder to be sent at a later date

Parameters

string $to
string $format

Returns

\Pop\Mail\Mail

sendFrom()

sendFrom(string  $from = null, boolean  $delete = false) : \Pop\Mail\Mail

Send mail message or messages that are saved in a folder.

This method depends on the server being set up correctly as an SMTP server and sendmail being correctly defined in the php.ini file.

Parameters

string $from
boolean $delete

Returns

\Pop\Mail\Mail

buildHeaders()

buildHeaders() : string

Build headers

Returns

string

getEmailFromFile()

getEmailFromFile(string  $filename) : array

Get email data from file

Parameters

string $filename

Throws

\Pop\Mail\Exception

Returns

array