我已经通过这个线程在这里工作: Sending HTML email from PHP格式HTML与PHP邮件
在过去的5小时,由于某种原因,不能让我的PHP生成HTML的邮件。
这是我有:
// Construct Mail:
$message = "<html><body>Some text<br />New line<p>New para</p></body></html>";
// Send Mail:
$to = "$UserMail";
$subject = "[Skills Exchange Network] Event Created";
$header = 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-Type: text/html; charset=ISO-8859-1' . "\r\n";
$headers .= 'From: Skills Exchange Network <Mail Address is here>' . "\r\n";
$headers .= 'Cc: Skills Exchange Network <Mail Address is here>' . "\r\n";
$SendMail = mail($to,$subject,$message,$headers);
这是我收到:
从技能交换网RNCC:技能交换网络RN
我真的不知所措...
下面是我现在拥有的:
// Construct Mail:
$message = "<html><body>Some text<br />New line<p>New para</p></body></html>";
// Send Mail:
$to = "$UserMail";
$subject = "[Skills Exchange Network] Event Created";
// To send HTML mail, the Content-type header must be set
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1" . "\r\n";
// Additional Headers:
$headers .= "From: Skills Exchange Network <[email protected]>" . "\r\n";
$headers .= "Cc: Skills Exchange Network <[email protected]>" . "\r\n";
$SendMail = mail($to, $subject, $message, $headers);
这里就是我得到:
Subject: [Skills Exchange Network] Event Created
MIME-Version: 1.0rnContent-Type: text/html; charset=ISO-8859-1rnFrom: Skills Exchange Network <[email protected]>rnCc: Skills Exchange Network <[email protected]>rn
Message-Id: <[email protected]>
From: [email protected]
Date: Thu, 18 Jul 2013 10:13:08 -0500
X-Antivirus: AVG for E-mail 2013.0.3349 [3204/6500]
X-AVG-ID: ID58DD9571-36429B43
<html><body>Some text<br />New line<p>New para</p></body></html>
最好是使用表格进行电子邮件标记 – DarkBee
这是您收到的电子邮件正文还是这个主题? –
有两件事情是错误的:标题和正文。我收到邮件,但标题格式不正确,HTML以纯文本格式显示。可能是因为标题错误。 – Harlequin