You are here

public function ForwardMailSystem::mail in Forward 7

Same name and namespace in other branches
  1. 7.3 forward.mail.inc \ForwardMailSystem::mail()
  2. 7.2 forward.module \ForwardMailSystem::mail()

Send an e-mail message, using Drupal variables and default settings.

Parameters

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

Return value

TRUE if the mail was successfully accepted, otherwise FALSE.

Overrides MailSystemInterface::mail

See also

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

drupal_mail()

File

./forward.module, line 1647

Class

ForwardMailSystem
Modify the drupal mail system to send HTML emails for the forward module.

Code

public function mail(array $message) {
  $mimeheaders = array();
  foreach ($message['headers'] as $name => $value) {
    $mimeheaders[] = $name . ': ' . mime_header_encode($value);
  }
  $line_endings = variable_get('mail_line_endings', MAIL_LINE_ENDINGS);
  return mail($message['to'], mime_header_encode($message['subject']), preg_replace('@\\r?\\n@', $line_endings, $message['body']), join("\n", $mimeheaders));
}