public function TestPhpMailFailure::mail in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/system_mail_failure_test/src/Plugin/Mail/TestPhpMailFailure.php \Drupal\system_mail_failure_test\Plugin\Mail\TestPhpMailFailure::mail()
- 9 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/function.mail.php
\Drupal\Core\Mail\MailManagerInterface::mail()
File
- core/
modules/ system/ tests/ modules/ system_mail_failure_test/ src/ Plugin/ Mail/ TestPhpMailFailure.php, line 28
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;
}