[英]specials characters when sending mail via Php
I've got this php code that send an email with some texts and special characters : 我有此php代码,该代码发送带有一些文本和特殊字符的电子邮件:
// send email
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$mail_user= "myMail@gmail.com";
$subject = "Message d'alerte" ;
$message = utf8_encode("Une personne est en danger !\r\n \r\n <br> Nom :$nom <br> Prénom : $prenom <br> Numéro de téléphone : $phone\r\n <br> Type de bateau : $boat\r\n Téléphone du proche : $phoneFriend <br> ");
mail($mail_user, $subject, $message, $headers);
Problem 问题
The user receive this email : 用户收到此电子邮件:
Une personne est en danger !
Nom :amir
Prénom : Khalida
Numéro de téléphone : 95626
Coordonnées :
Téléphone du proche
As you can see, every character with accents are not supported.. How can I do to change "é" by "é" when sending the email ? 如您所见,不支持带有重音符号的每个字符。.在发送电子邮件时,如何更改“é”和“é”?
Thx 谢谢
Change your charset: 更改您的字符集:
$headers .= "From: $from \r\n";
$headers .= 'Content-Type: text/html; charset=UTF-8\r\n';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.