public function MailMIME::toEmail in Mail MIME 7.2
Same name and namespace in other branches
- 8.2 mailmime.inc \MailMIME::toEmail()
 - 6.2 mailmime.inc \MailMIME::toEmail()
 - 6 mailmime.inc \MailMIME::toEmail()
 - 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 644  - 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 = self::toHeaders($headers);
  $mime_headers = $this
    ->headers();
  return array(
    array_diff_key($headers, $mime_headers) + $mime_headers,
    $this
      ->get(NULL, NULL, TRUE),
  );
}