Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何以html格式发送提交的表单数据?_Php_Forms - Fatal编程技术网

Php 如何以html格式发送提交的表单数据?

Php 如何以html格式发送提交的表单数据?,php,forms,Php,Forms,在这里,我有正确的工作代码,将提交的表格数据发送到电子邮件,工作正常, 但我想在我的电子邮件中接收html格式的提交数据, 我该怎么做? 范例 最佳解决方案:使用并查看他们的各种示例。如果您仍然希望继续使用代码,则需要修改并添加内容类型: $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; $headers .= 'From: '.$em

在这里,我有正确的工作代码,将提交的表格数据发送到电子邮件,工作正常, 但我想在我的电子邮件中接收html格式的提交数据, 我该怎么做? 范例

最佳解决方案:使用并查看他们的各种示例。如果您仍然希望继续使用代码,则需要修改并添加内容类型:

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";

$headers .= 'From: '.$email_from."\r\n";
$headers .= 'Reply-To: '.$email_from."\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";

$headers .= 'From: '.$email_from."\r\n";
$headers .= 'Reply-To: '.$email_from."\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();