Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • FallbackMailer
  • Message
  • MimePart
  • SendmailMailer
  • SmtpMailer

Interfaces

  • IMailer

Exceptions

  • FallbackMailerException
  • SendException
  • SmtpException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases

Class Message

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

Nette\Mail\MimePart uses Nette\SmartObject
Extended by Nette\Mail\Message
Namespace: Nette\Mail
Located at Mail/Message.php
Methods summary
public
# __construct( )
public Nette\Mail\Message
# setFrom( string $email, string $name = null )

Sets the sender of the message.

Sets the sender of the message.

Parameters

$email
or format "John Doe" &lt;<a href="mailto:doe&#64;example.com">doe&#64;<!---->example.com</a>&gt;
$name

Returns

Nette\Mail\Message
static
public array
# getFrom( )

Returns the sender of the message.

Returns the sender of the message.

Returns

array
array
public Nette\Mail\Message
# addReplyTo( string $email, string $name = null )

Adds the reply-to address.

Adds the reply-to address.

Parameters

$email
or format "John Doe" &lt;<a href="mailto:doe&#64;example.com">doe&#64;<!---->example.com</a>&gt;
$name

Returns

Nette\Mail\Message
static
public Nette\Mail\Message
# setSubject( string $subject )

Sets the subject of the message.

Sets the subject of the message.

Parameters

$subject

Returns

Nette\Mail\Message
static
public string|null
# getSubject( )

Returns the subject of the message.

Returns the subject of the message.

Returns

string|null
string|null
public Nette\Mail\Message
# addTo( string $email, string $name = null )

Adds email recipient.

Adds email recipient.

Parameters

$email
or format "John Doe" &lt;<a href="mailto:doe&#64;example.com">doe&#64;<!---->example.com</a>&gt;
$name

Returns

Nette\Mail\Message
static
public Nette\Mail\Message
# addCc( string $email, string $name = null )

Adds carbon copy email recipient.

Adds carbon copy email recipient.

Parameters

$email
or format "John Doe" &lt;<a href="mailto:doe&#64;example.com">doe&#64;<!---->example.com</a>&gt;
$name

Returns

Nette\Mail\Message
static
public Nette\Mail\Message
# addBcc( string $email, string $name = null )

Adds blind carbon copy email recipient.

Adds blind carbon copy email recipient.

Parameters

$email
or format "John Doe" &lt;<a href="mailto:doe&#64;example.com">doe&#64;<!---->example.com</a>&gt;
$name

Returns

Nette\Mail\Message
static
public Nette\Mail\Message
# setReturnPath( string $email )

Sets the Return-Path header of the message.

Sets the Return-Path header of the message.

Parameters

$email
email

Returns

Nette\Mail\Message
static
public string
# getReturnPath( )

Returns the Return-Path header.

Returns the Return-Path header.

Returns

string
string
public Nette\Mail\Message
# setPriority( integer $priority )

Sets email priority.

Sets email priority.

Parameters

$priority

Returns

Nette\Mail\Message
static
public integer
# getPriority( )

Returns email priority.

Returns email priority.

Returns

integer
int
public Nette\Mail\Message
# setHtmlBody( string $html, string $basePath = null )

Sets HTML body.

Sets HTML body.

Parameters

$html
$basePath

Returns

Nette\Mail\Message
static
public string
# getHtmlBody( )

Gets HTML body.

Gets HTML body.

Returns

string
string
public Nette\Mail\MimePart
# addEmbeddedFile( string $file, string $content = null, string $contentType = null )

Adds embedded file.

Adds embedded file.

Parameters

$file
$content
$contentType

Returns

Nette\Mail\MimePart
MimePart
public Nette\Mail\Message
# addInlinePart( Nette\Mail\MimePart $part )

Adds inlined Mime Part.

Adds inlined Mime Part.

Parameters

$part

Returns

Nette\Mail\Message
static
public Nette\Mail\MimePart
# addAttachment( string $file, string $content = null, string $contentType = null )

Adds attachment.

Adds attachment.

Parameters

$file
$content
$contentType

Returns

Nette\Mail\MimePart
MimePart
public Nette\Mail\MimePart[]
# getAttachments( )

Gets all email attachments.

Gets all email attachments.

Returns

Nette\Mail\MimePart[]
MimePart[]
public string
# generateMessage( )

Returns encoded message.

Returns encoded message.

Returns

string
string
protected Nette\Mail\Message
# build( )

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

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

Returns

Nette\Mail\Message
static
protected string
# buildText( string $html )

Builds text content.

Builds text content.

Parameters

$html

Returns

string
string
Methods inherited from Nette\Mail\MimePart
addPart(), clearHeader(), getBody(), getEncodedHeader(), getEncodedMessage(), getEncoding(), getHeader(), getHeaders(), setBody(), setContentType(), setEncoding(), setHeader()
Methods used from Nette\SmartObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
integer HIGH

Priority

Priority

#1
integer NORMAL

Priority

Priority

#3
integer LOW

Priority

Priority

#5
Constants inherited from Nette\Mail\MimePart
ENCODING_7BIT, ENCODING_8BIT, ENCODING_BASE64, ENCODING_QUOTED_PRINTABLE, EOL, LINE_LENGTH
Properties summary
public static array $defaultHeaders
#[ 'MIME-Version' => '1.0', 'X-Mailer' => 'Nette Framework', ]
Magic properties summary
public string $subject
public string $htmlBody
Magic properties inherited from Nette\Mail\MimePart
$body
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0