在php中使用mailto()函数的HTML电子邮件

时间:2012-06-13 17:11:29

标签: php email

  

可能重复:
  Sending HTML email from PHP

我需要使用php mailto()函数发送html邮件。我有mail.html(这是我需要发送的邮件正文)在我保存邮件脚本的同一个文件夹中。我想要邮件正文中的html内容的内容而不是附件。我该怎么做?提前谢谢。

1 个答案:

答案 0 :(得分:0)

请务必在邮件中添加HTML标头:

<?php
$header = "Content-Type: text/html\n";   
mail($to, $subject, $text, $header);
?>