Error message
You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).function TestingMailSystem::mail
Accept an e-mail message and store it in a variable.
Parameters
$message: An e-mail message.
Return value
TRUE if the mail was successfully accepted, otherwise FALSE.
Overrides DefaultMailSystem::mail
File
-
modules/
system/ system.mail.inc, line 163
Class
- TestingMailSystem
- A mail sending implementation that captures sent messages to a variable.
Code
public function mail (array $message) {
$captured_emails = variable_get ('drupal_test_email_collector', array());
$captured_emails[] = $message;
variable_set ('drupal_test_email_collector', $captured_emails);
return TRUE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.