【发布时间】:2015-01-04 04:12:09
【问题描述】:
所以使用MIME,我创建了一个php 邮件系统,但似乎无法解决我想要在电子邮件顶部附加的标题图像的一个问题。
我使用的代码导致以下错误:
Parse error: syntax error, unexpected 'cid' (T_STRING) in W:\xampp\htdocs\website1\show_notifications_to_send.php on line 152
我正在使用的代码在这个块中如下:
$headers = "Content-Type: "
$headers = "From: admin@____.com\n"; //left out email
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=UTF-8\n";
$headers .= "Content-Location: CID:website1\img_004.jpg ; //Changed URLs slightly
$headers .= "Content-ID: <img_004.jpg>";
$headers .= "Content-Type: IMAGE/GIF";
$headers .= "Content-Transfer-Encoding: BASE64";
$fullImportStatusMessage="<style>body{font-size: 12px;color:#666;font-family: Verdana, Geneva, sans-serif;}table{border: 1px solid #e7e7e7;padding: 6px 24px;}</style><html><body> <IMG SRC="cid:img_004.jpg" ALT="IETF logo"> .$updatedEmailText.</body></html>"; //This is the line with error
$dryrun=false;
我可以添加更多代码,但我认为问题出在此。感谢您的任何提示和建议
编辑:如果我问错了我的问题,我看到我被否决了,很抱歉。我会检查规则
【问题讨论】:
-
第四个标题缺少双引号。为什么会有两个
Content-Type:标头? -
那个双引号实际上在代码中,我只是搞砸了复制它,我现在编辑它。谢谢你给我看。至于有 2 个内容标题我会检查一下。我只是按照教程告诉我的去做