You are here

public function TestPhpMailFailure::mail in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/system_mail_failure_test/src/Plugin/Mail/TestPhpMailFailure.php \Drupal\system_mail_failure_test\Plugin\Mail\TestPhpMailFailure::mail()

Sends an email message.

Parameters

array $message: A message array, as described in hook_mail_alter().

Return value

bool TRUE if the mail was successfully accepted, otherwise FALSE.

Overrides PhpMail::mail

See also

http://php.net/manual/en/function.mail.php

\Drupal\Core\Mail\MailManagerInterface::mail()

File

core/modules/system/tests/modules/system_mail_failure_test/src/Plugin/Mail/TestPhpMailFailure.php, line 33
Contains \Drupal\system_mail_failure_test\Plugin\Mail\TestPhpMailFailure.

Class

TestPhpMailFailure
Defines a mail sending implementation that always fails.

Namespace

Drupal\system_mail_failure_test\Plugin\Mail

Code

public function mail(array $message) {

  // Simulate a failed mail send by returning FALSE.
  return FALSE;
}