email - PHP mail() changing some characters to htmlentities? -
my php mail() script changes ! exclamation mark on email clients such hotmail %21 when ! in  tag in email body.
here's script
$to = "myemail@outlook.com"; $subject = "password reset"; $body = "<a href=\"http://example.com/#!/page\">link 1</a>         <br><br>         without href: http://example.com/#!/page - regular text     "; $headers = "from: no-reply@example.com\r\n"; $headers .= "reply-to: no-reply@example.com\r\n"; $headers .= "return-path: no-reply@example.com\r\n"; $headers .= "x-mailer: php5\n"; $headers .= 'mime-version: 1.0' . "\n"; $headers .= 'content-type: text/html; charset=utf-8' . "\r\n"; mail($to,$subject,$body,$headers);   so in script above, ! changed %21 when it's link, regular text keeps /#!/instead of transforming /#%21/
how go fixing issue doesn't change %21?
some characters encoded because not valid urls. in case url code points replaced percent-encoded byte %.
Comments
Post a Comment