You are here

public function InvoiceMailSystem::mail in Commerce Invoice Receipt 7.2

Same name and namespace in other branches
  1. 7 includes/commerce_invoice_receipt.admin.inc \InvoiceMailSystem::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

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

drupal_mail()

File

./commerce_invoice_receipt.mailsystem.inc, line 37
Contains the mailsystem used by Commerce Invoice Receipt module.

Class

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