Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.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
我对PHPMailer包有问题_Php_Forms_Styles_Coding Style_Phpmailer - Fatal编程技术网

我对PHPMailer包有问题

我对PHPMailer包有问题,php,forms,styles,coding-style,phpmailer,Php,Forms,Styles,Coding Style,Phpmailer,我正在尝试从PHPMailer发送电子邮件。一切正常,但问题是即使在编写$mail->IsHTML(true)之后,它仍在发送带有HTML标记的电子邮件。下面是我发送电子邮件的代码 <?php session_start(); if ($_POST['Submit'] == 'Send') { if (strcmp(md5($_POST['user_code']),$_SESSION['ckey'])) { header("Location: sendmail.php?msg

我正在尝试从PHPMailer发送电子邮件。一切正常,但问题是即使在编写
$mail->IsHTML(true)
之后,它仍在发送带有HTML标记的电子邮件。下面是我发送电子邮件的代码

 <?php
session_start();
if ($_POST['Submit'] == 'Send')
{
if (strcmp(md5($_POST['user_code']),$_SESSION['ckey']))
{ 
header("Location: sendmail.php?msg=ERROR: Invalid Verification Code");
exit();
  } 


$to = $_POST['toemail'];
$subject = $_POST['subject'];
$message = $_POST["message"];
$message = isHTML(true);
$fromemail = $_POST['fromemail'];
$fromname = $_POST['fromname'];
$lt= '<';
$gt= '>';
$sp= ' ';
$from= 'From:';
$headers = "From: $from\r\n";
$headers .= "Content-Type: text/html\r\n";
mail($to,$subject,$message,$headers);
header("Location: sendmail.php?msg= Mail Sent!");
exit();

首先,您应该检查服务器的设置


尝试使用mail('您的_email@test.com'测试','xyz')

您正在覆盖$message变量<代码>$message=$\u POST[“message”]$消息=isHTML(真)。更好的用户PHPMailer库您没有使用PHPMailer,您在这里使用的是PHP自己的原生
邮件
函数。:请勿使用!此标记引用了一个完全固执己见的主题,因此不再是主题。我尝试使用此$headers.=“MIME版本:1.0\r\n”$标题。=“内容类型:text/html;\r\n”;它的工作,但我保留用户34213123的电子邮件