我有一个联系页面(contact.php),当人们填写联系方式时会发送一个表单(formsend.php)。
contact.php 有:
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="ISO-8859-1">
Contact.php 页面很好,可以很好地显示我的拉丁葡萄牙语字符(ã、é 等)。
但是当我收到电子邮件时(当它使用 formsend.php 时),我得到的字段是人们用乱七八糟的字符注册的:João 是 Joã£o,等等。
在 formsend.php 我尝试添加:
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
和
header('Content-Type: text/html; charset=iso-8859-1');
和
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="ISO-8859-1">
也是。没有任何效果。
似乎是formsend.php 文件在这里失败了。
我可以做些什么来确保我在包含用户信息的电子邮件中收到格式正确的字符?