You are here

public function MailMIME::toEmail in Mail MIME 6

Same name and namespace in other branches
  1. 8.2 mailmime.inc \MailMIME::toEmail()
  2. 6.2 mailmime.inc \MailMIME::toEmail()
  3. 7.2 mailmime.inc \MailMIME::toEmail()
  4. 7 mailmime.inc \MailMIME::toEmail()

Return a (headers, body) pair for sending.

Merge the $headers parameter with the MIME headers and return it with the fully-encoded message body.

Parameters

$headers: The original message headers array.

Return value

array An array containing two elements, the merged headers and the fully- encoded message body, both ready to send.

File

./mailmime.inc, line 631
Provides the MailMIME class for creating MIME-formatted email messages.

Class

MailMIME
The MailMIME class is used to create MIME email messages.

Code

public function toEmail($headers) {
  $headers = MailMIME::toHeaders($headers);
  $mime_headers = $this
    ->headers();
  return array(
    array_diff_key($headers, $mime_headers) + $mime_headers,
    $this
      ->get(NULL, NULL, TRUE),
  );
}