Version: current

# Class TestMailer

  Object
  Mailer
  TestMailer

Package: sapphire\email
Located at sapphire/dev/TestMailer.php

## Methods summary

`public boolean` | # `sendPlain( string $to, string $from, string $subject, string $plainContent, boolean $attachedFiles = false, array $customHeaders = false )` Send a plain-text email. TestMailer will merely record that the email was asked to be sent, without sending anything. Send a plain-text email. TestMailer will merely record that the email was asked to be sent, without sending anything. #### Parameters $to string $to $from string $from $subject string §subject $plainContent string $plainContent $attachedFiles bool $attachedFiles $customHeaders array $customheaders #### Returns `boolean` bool #### Overrides `Mailer::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 TestMailer will merely record that the email was asked to be sent, without sending anything. Send a multi-part HTML email TestMailer will merely record that the email was asked to be sent, without sending anything. #### Returns `boolean` bool #### Overrides `Mailer::sendHTML`
`public` | # `clearEmails( )` Clear the log of emails sent Clear the log of emails sent
`public An` | # `findEmail( mixed $to, mixed $from = null, mixed $subject = null, mixed $content = null )` Search for an email that was sent. All of the parameters can either be a string, or, if they start with "/", a PREG-compatible regular expression. Search for an email that was sent. All of the parameters can either be a string, or, if they start with "/", a PREG-compatible regular expression. #### Parameters $to $to $from $from $subject $subject $content $content #### Returns `An` array containing the keys: 'type','to','from','subject','content', 'plainContent','attachedFiles','customHeaders','htmlContent',inlineImages'

### Methods inherited from Mailer

`get_encoding()`, `get_fallback_sender()`, `replace_sender()`, `set_encoding()`, `set_fallback_sender()`

### 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 array` | $emailsSent | #

### Properties inherited from Mailer

`$encoding`, `$fallback_sender`

### 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. -