Mail_Mime::encodeHeader() – encode header value


require_once 'Mail/mime.php';

string encodeHeader ( string $name , string $value , string $charset , string $encoding )


Returns encoded header value as for RFC2047.


  • string $name - The header name

  • string $value - The header body

  • string $charset - Character set used in header body

  • string $encoding - Encoding ("base64" or "quoted-printable")

Return value

string - Returns encoded header body (without a name)


This function can not be called statically.

set plain text part (Previous) constructor (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

Note by:
If the parameters $charset and $encoding are always required, then I wonder what the $params['head_encoding'] and $params['head_charset'] passed to the Mail_mime constructur are for. The relationship between the two should be explained.