You are here

public function UserImportMailSystem::mail in User Import 7.2

Same name and namespace in other branches
  1. 7.3 user_import.module \UserImportMailSystem::mail()

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

" title="http://php.net/manual/en/function.mail.php " rel="nofollow">http://php.net/manual/en/function.mail.php </a> *

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

<a href="http://php.net/manual/en/function.mail.php

drupal_mail()

File

./user_import.module, line 933
Import or update users with data from a comma separated file (csv).

Class

UserImportMailSystem
Modify the drupal mail system to send HTML emails.

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));
}