class Message extends MimePart

Mail provides functionality to compose and send both text and MIME-compliant multipart email messages.

Constants

HIGH

Priority

NORMAL

Priority

LOW

Priority

Properties

static array $defaultHeaders
string $subject
mixed $htmlBody

Methods

__construct()

No description

setFrom($email, $name = NULL)

Sets the sender of the message.

array
getFrom()

Returns the sender of the message.

addReplyTo($email, $name = NULL)

Adds the reply-to address.

setSubject($subject)

Sets the subject of the message.

string
getSubject()

Returns the subject of the message.

addTo($email, $name = NULL)

Adds email recipient.

addCc($email, $name = NULL)

Adds carbon copy email recipient.

addBcc($email, $name = NULL)

Adds blind carbon copy email recipient.

setReturnPath($email)

Sets the Return-Path header of the message.

string
getReturnPath()

Returns the Return-Path header.

setPriority($priority)

Sets email priority.

int
getPriority()

Returns email priority.

setHtmlBody($html, $basePath = NULL)

Sets HTML body.

mixed
getHtmlBody()

Gets HTML body.

addEmbeddedFile($file, $content = NULL, $contentType = NULL)

Adds embedded file.

addAttachment($file, $content = NULL, $contentType = NULL)

Adds attachment.

string
generateMessage()

Returns encoded message.

build()

Builds email. Does not modify itself, but returns a new object.

string
buildText($html)

Builds text content.

Details

at line 45
__construct()

No description

at line 60
Message setFrom($email, $name = NULL)

Sets the sender of the message.

Parameters

$email
$name

Return Value

Message

at line 71
array getFrom()

Returns the sender of the message.

Return Value

array

at line 83
Message addReplyTo($email, $name = NULL)

Adds the reply-to address.

Parameters

$email
$name

Return Value

Message

at line 95
Message setSubject($subject)

Sets the subject of the message.

Parameters

$subject

Return Value

Message

at line 106
string getSubject()

Returns the subject of the message.

Return Value

string

at line 118
Message addTo($email, $name = NULL)

Adds email recipient.

Parameters

$email
$name

Return Value

Message

at line 131
Message addCc($email, $name = NULL)

Adds carbon copy email recipient.

Parameters

$email
$name

Return Value

Message

at line 144
Message addBcc($email, $name = NULL)

Adds blind carbon copy email recipient.

Parameters

$email
$name

Return Value

Message

at line 172
Message setReturnPath($email)

Sets the Return-Path header of the message.

Parameters

$email

Return Value

Message

at line 183
string getReturnPath()

Returns the Return-Path header.

Return Value

string

at line 194
Message setPriority($priority)

Sets email priority.

Parameters

$priority

Return Value

Message

at line 205
int getPriority()

Returns email priority.

Return Value

int

at line 217
Message setHtmlBody($html, $basePath = NULL)

Sets HTML body.

Parameters

$html
$basePath

Return Value

Message

at line 262
mixed getHtmlBody()

Gets HTML body.

Return Value

mixed

at line 275
MimePart addEmbeddedFile($file, $content = NULL, $contentType = NULL)

Adds embedded file.

Parameters

$file
$content
$contentType

Return Value

MimePart

at line 289
MimePart addAttachment($file, $content = NULL, $contentType = NULL)

Adds attachment.

Parameters

$file
$content
$contentType

Return Value

MimePart

at line 325
string generateMessage()

Returns encoded message.

Return Value

string

at line 335
protected Message build()

Builds email. Does not modify itself, but returns a new object.

Return Value

Message

at line 383
protected string buildText($html)

Builds text content.

Parameters

$html

Return Value

string