public static function MailMIME::encodeEmail in Mail MIME 6.2
Same name and namespace in other branches
- 8.2 mailmime.inc \MailMIME::encodeEmail()
- 6 mailmime.inc \MailMIME::encodeEmail()
- 7.2 mailmime.inc \MailMIME::encodeEmail()
- 7 mailmime.inc \MailMIME::encodeEmail()
Convert message headers and body into an encoded string.
Parameters
$headers: The message headers as a string or an array.
$body: The message body as a stringi or an array.
Return value
The fully-encoded email message as a string.
File
- ./
mailmime.inc, line 837 - Provides the MailMIME class for creating MIME-formatted email messages.
Class
- MailMIME
- The MailMIME class is used to create MIME email messages.
Code
public static function encodeEmail($headers, $body) {
// Standardize capitalization of header names.
$headers = self::toHeaders($headers);
$output = '';
foreach ($headers as $name => $value) {
$output .= $name . ': ' . Mail_mimePart::encodeHeader($name, $value, 'UTF-8', 'quoted-printable', MAIL_MIME_CRLF) . MAIL_MIME_CRLF;
}
$output .= MAIL_MIME_CRLF . self::concat($body);
return $output;
}