Class Mail (namespace Nette\Mail)


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

Object
   |
   --MailMimePart
      |
      --Mail
Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /Mail/Mail.php (line 27)
Public Method Summary
Mail
MailMimePart
addAttachment (string $file, [string $content = NULL], [string $contentType = NULL])
Adds attachment.
Mail
addBcc (string $email, [string $name = NULL])
Adds blind carbon copy email recipient.
Mail
addCc (string $email, [string $name = NULL])
Adds carbon copy email recipient.
MailMimePart
addEmbeddedFile (string $file, [string $content = NULL], [string $contentType = NULL])
Adds embedded file.
Mail
addReplyTo (string $email, [string $name = NULL])
Adds the reply-to address.
Mail
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.
Mail
setFrom (string $email, [string $name = NULL])
Sets the sender of the message.
Mail
setHtmlBody (string|Nette\Templates\ITemplate $html, [mixed $basePath = NULL])
Sets HTML body.
Mail
setMailer (IMailer $mailer)
Sets the mailer.
Mail
setPriority (int $priority)
Sets email priority.
Mail
setReturnPath (string $email)
Sets the Return-Path header of the message.
Mail
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 MailMimePart
addPart(), clearHeader(), encodeQuotedPrintable(), generateMessage(), getBody(), getEncodedHeader(), getEncoding(), getHeader(), getHeaders(), setBody(), setContentType(), setEncoding(), setHeader()
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Constant Summary
int HIGH 1

line 30

Priority
int LOW 5

line 32

Priority
int NORMAL 3

line 31

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

line 39

static IMailer $defaultMailer 'Nette\Mail\SendmailMailer'

line 36


Method Details

line 64

__construct

public Mail __construct ()

Output
Mail  

line 297

addAttachment

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

Adds attachment.

Input
string $file
string $content
string $contentType
Output
MailMimePart  

line 171

addBcc

public Mail 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
Mail provides a fluent interface

line 157

addCc

public Mail 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
Mail provides a fluent interface

line 277

addEmbeddedFile

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

Adds embedded file.

Input
string $file
string $content
string $contentType
Output
MailMimePart  

line 105

addReplyTo

public Mail 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
Mail provides a fluent interface

line 143

addTo

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

Adds email recipient.

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

line 375

build

protected void build ()

Builds e-mail.

Output
void  

line 424

buildHtml

protected void buildHtml ()

Builds HTML content.

Output
void  

line 455

buildText

protected void buildText ()

Builds text content.

Output
void  

line 92

getFrom

public array getFrom ()

Returns the sender of the message.

Output
array  

line 263

getHtmlBody

public mixed getHtmlBody ()

Gets HTML body.

Output
mixed  

line 360

getMailer

public IMailer getMailer ()

Returns mailer.

Output
IMailer  

line 237

getPriority

public int getPriority ()

Returns email priority.

Output
int  

line 213

getReturnPath

public string getReturnPath ()

Returns the Return-Path header.

Output
string  

line 130

getSubject

public string getSubject ()

Returns the subject of the message.

Output
string  

line 336

send

public void send ()

Sends e-mail.

Output
void  

line 80

setFrom

public Mail 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
Mail provides a fluent interface

line 250

setHtmlBody

public Mail setHtmlBody (string|Nette\Templates\ITemplate $html, [mixed $basePath = NULL])

Sets HTML body.

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

line 348

setMailer

public Mail setMailer (IMailer $mailer)

Sets the mailer.

Input
IMailer $mailer
Output
Mail provides a fluent interface

line 225

setPriority

public Mail setPriority (int $priority)

Sets email priority.

Input
int $priority
Output
Mail provides a fluent interface

line 201

setReturnPath

public Mail setReturnPath (string $email)

Sets the Return-Path header of the message.

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

line 118

setSubject

public Mail setSubject (string $subject)

Sets the subject of the message.

Input
string $subject
Output
Mail provides a fluent interface