Class NMail (namespace NMail)


NMail provides functionality to compose and send both text and MIME-compliant multipart e-mail messages.

NObject
   |
   --NMailMimePart
      |
      --NMail
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Mail/Mail.php (line 39)
Public Method Summary
NMail
NMailMimePart
addAttachment (string $file, [string $content = NULL], [string $contentType = NULL])
Adds attachment.
NMail
addBcc (string $email, [string $name = NULL])
Adds blind carbon copy email recipient.
NMail
addCc (string $email, [string $name = NULL])
Adds carbon copy email recipient.
NMailMimePart
addEmbeddedFile (string $file, [string $content = NULL], [string $contentType = NULL])
Adds embedded file.
NMail
addReplyTo (string $email, [string $name = NULL])
Adds the reply-to address.
NMail
addTo (string $email, [string $name = NULL])
Adds email recipient.
array
getFrom ()
Returns the sender of the message.
mixed
Gets HTML body.
IMailer
Returns mailer.
int
Returns email priority.
string
Returns the Return-Path header.
string
Returns the subject of the message.
void
send ()
Sends e-mail.
NMail
setFrom (string $email, [string $name = NULL])
Sets the sender of the message.
NMail
setHtmlBody (string|ITemplate $html, [mixed $basePath = NULL])
Sets HTML body.
NMail
setMailer (IMailer $mailer)
Sets the mailer.
NMail
setPriority (int $priority)
Sets email priority.
NMail
setReturnPath (string $email)
Sets the Return-Path header of the message.
NMail
setSubject (string $subject)
Sets the subject of the message.
Protected Method Summary
protected void
build ()
Builds e-mail.
protected void
Builds HTML content.
protected void
Builds text content.
Methods Inherited From NMailMimePart
addPart(), clearHeader(), encodeQuotedPrintable(), generateMessage(), getBody(), getEncodedHeader(), getEncoding(), getHeader(), getHeaders(), setBody(), setContentType(), setEncoding(), setHeader()
Methods Inherited From NObject
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Constant Summary
int HIGH 1

line 42

Priority
int LOW 5

line 44

Priority
int NORMAL 3

line 43

Priority
Constants Inherited From NMailMimePart
ENCODING_7BIT, ENCODING_8BIT, ENCODING_BASE64, ENCODING_QUOTED_PRINTABLE, EOL, LINE_LENGTH
Variable Summary
static array $defaultHeaders array( 'MIME-Version' => '1.0', 'X-Mailer' => 'Nette Framework', )

line 51

static IMailer $defaultMailer 'NSendmailMailer'

line 48


Method Details

line 76

__construct

public NMail __construct ()

Output
NMail  

line 309

addAttachment

public NMailMimePart addAttachment (string $file, [string $content = NULL], [string $contentType = NULL])

Adds attachment.

Input
string $file
string $content
string $contentType
Output
NMailMimePart  

line 183

addBcc

public NMail addBcc (string $email, [string $name = NULL])

Adds blind carbon copy email recipient.

Input
string $email e-mail or format "John Doe" <doe@example.com>
string $name
Output
NMail provides a fluent interface

line 169

addCc

public NMail addCc (string $email, [string $name = NULL])

Adds carbon copy email recipient.

Input
string $email e-mail or format "John Doe" <doe@example.com>
string $name
Output
NMail provides a fluent interface

line 289

addEmbeddedFile

public NMailMimePart addEmbeddedFile (string $file, [string $content = NULL], [string $contentType = NULL])

Adds embedded file.

Input
string $file
string $content
string $contentType
Output
NMailMimePart  

line 117

addReplyTo

public NMail addReplyTo (string $email, [string $name = NULL])

Adds the reply-to address.

Input
string $email e-mail or format "John Doe" <doe@example.com>
string $name
Output
NMail provides a fluent interface

line 155

addTo

public NMail addTo (string $email, [string $name = NULL])

Adds email recipient.

Input
string $email e-mail or format "John Doe" <doe@example.com>
string $name
Output
NMail provides a fluent interface

line 387

build

protected void build ()

Builds e-mail.

Output
void  

line 436

buildHtml

protected void buildHtml ()

Builds HTML content.

Output
void  

line 467

buildText

protected void buildText ()

Builds text content.

Output
void  

line 104

getFrom

public array getFrom ()

Returns the sender of the message.

Output
array  

line 275

getHtmlBody

public mixed getHtmlBody ()

Gets HTML body.

Output
mixed  

line 372

getMailer

public IMailer getMailer ()

Returns mailer.

Output
IMailer  

line 249

getPriority

public int getPriority ()

Returns email priority.

Output
int  

line 225

getReturnPath

public string getReturnPath ()

Returns the Return-Path header.

Output
string  

line 142

getSubject

public string getSubject ()

Returns the subject of the message.

Output
string  

line 348

send

public void send ()

Sends e-mail.

Output
void  

line 92

setFrom

public NMail setFrom (string $email, [string $name = NULL])

Sets the sender of the message.

Input
string $email e-mail or format "John Doe" <doe@example.com>
string $name
Output
NMail provides a fluent interface

line 262

setHtmlBody

public NMail setHtmlBody (string|ITemplate $html, [mixed $basePath = NULL])

Sets HTML body.

Input
string|ITemplate $html
mixed $basePath base-path or FALSE to disable parsing
Output
NMail provides a fluent interface

line 360

setMailer

public NMail setMailer (IMailer $mailer)

Sets the mailer.

Input
IMailer $mailer
Output
NMail provides a fluent interface

line 237

setPriority

public NMail setPriority (int $priority)

Sets email priority.

Input
int $priority
Output
NMail provides a fluent interface

line 213

setReturnPath

public NMail setReturnPath (string $email)

Sets the Return-Path header of the message.

Input
string $email e-mail
Output
NMail provides a fluent interface

line 130

setSubject

public NMail setSubject (string $subject)

Sets the subject of the message.

Input
string $subject
Output
NMail provides a fluent interface