We have introduced in detail in some previous articles
The following code is an example of a specific solution to garbled emails sent by PHP:
- < ?php
- # email.php 2009-11-04
- $name = $_POST['name' ];
- $mail = $_POST['mail'];
- $content = $_POST['content'];
- $ subject = 'Test only';
- $subject = "=?UTF-8?B?".
base64_encode($subject)."?="; - $body = "From:$mailnName:
$namennContent:$content"; - $headers = "MIME-Version: 1.0rn";
- $headers .= 'Content-type:
text/html; charset=utf-8' . "rn"; - $headers .= "Content-
Transfer-Encoding: 8bitrn"; - if(mail('*****@qq.com',
$subject,$body,$header)){ - echo 'success';
- }else{
- echo 'fail'; 🎜>}
?>-
I hope that with this understanding of this code, everyone can avoid the situation where PHP sends garbled emails.
http://www.bkjia.com/PHPjc/446172.html
www.bkjia.com
truehttp: //www.bkjia.com/PHPjc/446172.htmlTechArticleWe have introduced in some previous articles that the following code is a specific solution to garbled emails sent by PHP. Example: ?php #email.php2009-11-04 $ name =$_POST['name'];...