繁体   English   中英

我对 PHPMailer package 有疑问

[英]I have problem with the PHPMailer package

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

 <?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('your_email@test.com','test','xyz' ); 发送简单的消息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM