Version: current

# Class Mailer

Mailer objects are responsible for actually sending emails. The default Mailer class will use PHP's mail() function.

  Object
  Mailer

### Direct known subclasses

`TestMailer`

Package: sapphire\email
Located at sapphire/email/Mailer.php

## Methods summary

`public static` | # `set_fallback_sender( mixed $value )`
`public static` | # `get_fallback_sender( )`
`public static` | # `set_encoding( mixed $val )`
`public static` | # `get_encoding( )`
`public boolean` | # `sendPlain( string $to, string $from, string $subject, string $plainContent, boolean $attachedFiles = false, array $customheaders = false )` Send a plain-text email. Send a plain-text email. #### Parameters $to string $to $from string $from $subject string §subject $plainContent string $plainContent $attachedFiles bool $attachedFiles $customheaders array $customheaders #### Returns `boolean` bool #### Used by ``Email::sendPlain()``
`public boolean` | # `sendHTML( mixed $to, mixed $from, mixed $subject, mixed $htmlContent, mixed $attachedFiles = false, mixed $customheaders = false, mixed $plainContent = false, mixed $inlineImages = false )` Send a multi-part HTML email. Send a multi-part HTML email. #### Returns `boolean` bool #### Used by ``Email::send()``
`public static mixed` | # `replace_sender( mixed $headers, string $sender = false )` Заменяет отправителя в заголовках письма Заменяет отправителя в заголовках письма #### Parameters $headers mixed $headers строка или массив с заголовками письма $sender string $sender новый отправитель (по-умолчанию @link Mailer::get_fallback_sender()) #### Returns `mixed` обновленные заголовки

### Methods inherited from Object

`__call()`, `__construct()`, `__toString()`, `__wakeup()`, `addMethodsFrom()`, `addStaticVars()`, `addWrapperMethod()`, `add_extension()`, `add_static_var()`, `allMethodNames()`, `cacheToFile()`, `cacheToFileWithArgs()`, `clearCache()`, `combined_static()`, `create()`, `createMethod()`, `create_from_string()`, `defineMethods()`, `exists()`, `extInstance()`, `extend()`, `getCustomClass()`, `getExtensionInstance()`, `getExtensionInstances()`, `get_extensions()`, `get_static()`, `hasExtension()`, `hasMethod()`, `has_extension()`, `invokeWithExtensions()`, `is_a()`, `loadCache()`, `parentClass()`, `parse_class_spec()`, `remove_extension()`, `sanitiseCachename()`, `saveCache()`, `set_stat()`, `set_static()`, `set_uninherited()`, `stat()`, `strong_create()`, `uninherited()`, `uninherited_static()`, `useCustomClass()`

### Magic methods summary

## Properties summary

`protected static string` | $fallback_sender | # Отправитель для тех случаев когда пиьсмо не принимается Отправитель для тех случаев когда пиьсмо не принимается
`protected static string` | $encoding | # Mail encoding Mail encoding

### Properties inherited from Object

`$class`, `$extension_instances`, `$extensions`

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -