function 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
File
-
core/
modules/ system/ tests/ modules/ system_mail_failure_test/ src/ Plugin/ Mail/ TestPhpMailFailure.php, line 29
Class
- TestPhpMailFailure
- Defines a mail sending implementation that always fails.
Namespace
Drupal\system_mail_failure_test\Plugin\MailCode
public function mail(array $message) {
// Simulate a failed mail send by returning FALSE.
return FALSE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.