public function InvoiceMailSystem::mail in Commerce Invoice Receipt 7
Same name and namespace in other branches
- 7.2 commerce_invoice_receipt.mailsystem.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>
File
- includes/
commerce_invoice_receipt.admin.inc, line 108
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));
}