#!/www/server/bin/php -qC header_escape('éxample@example.com', true), 'éxample@example.com', "Don't escape plain email addresses in email headers", ); is( $mail->header_escape('éxample@example.com'), '=?utf-8?Q?=C3=A9xample@example.com?=', "Escape plain email in non-email headers", ); is( $mail->header_escape('Èxample User <èxample@example.com>', true), '=?utf-8?Q?=C3=88xample_User?= <èxample@example.com>', "Escape name but not email in email headers", ); is( $mail->header_escape('Example User ', true), 'Example User ', "Don't escape characters that don't need escaping" ); is( $mail->header_escape('example@example.com, éxample@example.com, Sömeone Ëlse ', true), 'example@example.com, éxample@example.com,=?utf-8?Q?_S=C3=B6meone_=C3=8Blse?= ', "Don't escape email addresses but escape realnames", ); is( $mail->header_escape('"Alfred E. Neuman" ', true), '"Alfred E. Neuman" ', "Don't remove quoting characters from realname", );