diff --git a/src/Polyfill.php b/src/Polyfill.php index 949e279..4fa4ad6 100644 --- a/src/Polyfill.php +++ b/src/Polyfill.php @@ -80,9 +80,18 @@ public static function rfc822ParseHeaders($headers, $defaultHost = 'UNKNOWN') ]; } - public static function rfc822WriteHeaders($string) + public static function rfc822WriteHeaders($mailbox, $hostname, $personal) { - return $string; + $ret = $mailbox; + if (!empty($hostname)) + { + $ret .= '@' . $hostname; + } + if (!empty($personal)) + { + $ret .= ' <' . $personal . '>'; + } + return $ret; } public static function utf7Decode($string)