Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

Interfaces

Exceptions

  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Mail

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

Object
Extended by MailMimePart
Extended by Mail
Package: Nette\Mail
Author: David Grudl
Located at Mail/Message.php
Methods summary
public
# __construct( )
public Mail
# setFrom( string $email, string $name = NULL )

Sets the sender of the message.

Sets the sender of the message.

Parameters

$email
string
email or format "John Doe" <doe@example.com>
$name
string

Returns

Mail
public array
# getFrom( )

Returns the sender of the message.

Returns the sender of the message.

Returns

array
public Mail
# addReplyTo( string $email, string $name = NULL )

Adds the reply-to address.

Adds the reply-to address.

Parameters

$email
string
email or format "John Doe" <doe@example.com>
$name
string

Returns

Mail
public Mail
# setSubject( string $subject )

Sets the subject of the message.

Sets the subject of the message.

Parameters

$subject
string

Returns

Mail
public string
# getSubject( )

Returns the subject of the message.

Returns the subject of the message.

Returns

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

Adds email recipient.

Adds email recipient.

Parameters

$email
string
email or format "John Doe" <doe@example.com>
$name
string

Returns

Mail
public Mail
# addCc( string $email, string $name = NULL )

Adds carbon copy email recipient.

Adds carbon copy email recipient.

Parameters

$email
string
email or format "John Doe" <doe@example.com>
$name
string

Returns

Mail
public Mail
# addBcc( string $email, string $name = NULL )

Adds blind carbon copy email recipient.

Adds blind carbon copy email recipient.

Parameters

$email
string
email or format "John Doe" <doe@example.com>
$name
string

Returns

Mail
public Mail
# setReturnPath( string $email )

Sets the Return-Path header of the message.

Sets the Return-Path header of the message.

Parameters

$email
string
email

Returns

Mail
public string
# getReturnPath( )

Returns the Return-Path header.

Returns the Return-Path header.

Returns

string
public Mail
# setPriority( integer $priority )

Sets email priority.

Sets email priority.

Parameters

$priority
integer

Returns

Mail
public integer
# getPriority( )

Returns email priority.

Returns email priority.

Returns

integer
public Mail
# setHtmlBody( string|ITemplate $html, mixed $basePath = NULL )

Sets HTML body.

Sets HTML body.

Parameters

$html
string|ITemplate
$basePath
mixed
base-path or FALSE to disable parsing

Returns

Mail
public mixed
# getHtmlBody( )

Gets HTML body.

Gets HTML body.

Returns

mixed
public MailMimePart
# addEmbeddedFile( string $file, string $content = NULL, string $contentType = NULL )

Adds embedded file.

Adds embedded file.

Parameters

$file
string
$content
string
$contentType
string

Returns

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

Adds attachment.

Adds attachment.

Parameters

$file
string
$content
string
$contentType
string

Returns

MailMimePart
public
# send( )

Sends email.

Sends email.

public Mail
# setMailer( IMailer $mailer )

Sets the mailer.

Sets the mailer.

Returns

Mail
public IMailer
# getMailer( )

Returns mailer.

Returns mailer.

Returns

IMailer
public string
# generateMessage( )

Returns encoded message.

Returns encoded message.

Returns

string

Overrides

MailMimePart::generateMessage()
protected Mail
# build( )

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

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

Returns

Mail
protected
# buildHtml( )

Builds HTML content.

Builds HTML content.

protected
# buildText( )

Builds text content.

Builds text content.

Methods inherited from MailMimePart
addPart(), clearHeader(), encodeQuotedPrintable(), getBody(), getEncodedHeader(), getEncoding(), getHeader(), getHeaders(), setBody(), setContentType(), setEncoding(), setHeader()
Methods inherited from Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
integer HIGH 1
#

Priority

Priority

integer NORMAL 3
#

Priority

Priority

integer LOW 5
#

Priority

Priority

Constants inherited from MailMimePart
ENCODING_7BIT, ENCODING_8BIT, ENCODING_BASE64, ENCODING_QUOTED_PRINTABLE, LINE_LENGTH
Properties summary
public static IMailer $defaultMailer 'SendmailMailer'
#
public static array $defaultHeaders array( 'MIME-Version' => '1.0', 'X-Mailer' => 'Nette Framework', )
#
Magic properties summary
public array $from
#
public string $subject
#
public string $returnPath
#
public integer $priority
#
public mixed $htmlBody
#
public IMailer $mailer
#
Magic properties inherited from MailMimePart
$body, $contentType, $encoding, $headers
Magic properties inherited from Object
$reflection
Nette Framework 2.0.18 (for PHP 5.2, un-prefixed) API documentation generated by ApiGen 2.8.0