PHP邮件格式

PHP邮件格式,php,email,Php,Email,我正试图发送一封html格式的电子邮件,但当它到达(在gmail和我的手机上)时,它已经删除了所有标签,只有几行文字(没有)。我正确设置了头MIME版本和内容类型,当我获取原始消息并将其放入html文件时,它与所有文本一起显示。没有类属性集,而是所有属性都存储在样式属性中。有人知道什么是删除标签和样式吗?是Gmail,还是我遗漏了什么 Delivered-To: xxx@gmail.com Received: by 10.220.91.15 with SMTP id xxxxxxxxx;

我正试图发送一封html格式的电子邮件,但当它到达(在gmail和我的手机上)时,它已经删除了所有标签,只有几行文字(没有
)。我正确设置了头
MIME版本
内容类型
,当我获取原始消息并将其放入html文件时,它与所有文本一起显示。没有
属性集,而是所有属性都存储在
样式
属性中。有人知道什么是删除标签和样式吗?是Gmail,还是我遗漏了什么

Delivered-To: xxx@gmail.com
Received: by 10.220.91.15 with SMTP id xxxxxxxxx;
        Mon, 20 Feb 2012 10:41:39 -0800 (PST)
Received: by 10.180.90.225 with SMTP id xxxxxxxxx;
        Mon, 20 Feb 2012 10:41:39 -0800 (PST)
Return-Path: <xxxxxxxxx@xxxxxxxxx.net>
Received: from xxxxxxxxx.net (xxxxxxxxx.net. [xxx.xxx.xxx.xxx])
        by mx.google.com with ESMTPS id xxxxxxxxx
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 20 Feb 2012 10:41:39 -0800 (PST)
Received-SPF: pass client-ip=xxx.xxx.xxx.xxx;
Authentication-Results: mx.google.com; spf=pass smtp.mail=xxxxxxxxx.net
Received: from xxxxxxxxx by xxxxxxxxx.net with local (Exim 4.69)
    (envelope-from <xxxxxxxxx@xxxxxxxxx.net>)
    id xxxxxxxxx
    for xxxxxxxxx@xxxxxxxxx.com; Mon, 20 Feb 2012 18:41:34 +0000
To: xxxxxxxxx@gmail.com
Subject: Email Subject
X-PHP-Script: xxxxxxxxx.co.uk/cronjob.php for xxx.xxx.xxx.xxx
From: xxxxxxxx <no-reply@xxxxxxxxx.co.uk>
MIME-Version: 1.0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Message-Id: <xxxxxxxxx@xxxxxxxxx.net>
Date: Mon, 20 Feb 2012 18:41:34 +0000
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - xxxxxxxxx.net
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [1119 32003] / [47 12]
X-AntiAbuse: Sender Address Domain - xxxxxxxxx.net
X-Source: /usr/local/lsws/fcgi-bin/lsphp-5.2.17
X-Source-Args: lsphp5:dig/public_html/xxxxxxxxx/cronjob.php
X-Source-Dir: xxxxxxxxx.co.uk:/public_html

<html><body style="color: #333;font-family: 'Myriad Pro';font-size: 18px;margin: 0;padding: 0;text-align: center;"><div style="background-color: #9C3;background-repeat: no-repeat;border: solid 1px #9C3;height: 32px;margin: 0 auto;width: 400px;"></div><div style="background-color: #FFF;border-bottom: solid 1px #9C3;border-left: solid 1px #9C3;border-right: solid 1px #9C3;margin: 0 auto;padding-bottom: 50px;width: 400px;"><div style="border-bottom: solid 1px #E1E1E1;padding-bottom: 10px;padding-top: 20px;">Hi xxxx,<br /><br />Here is a daily digest of recent interaction<br />regarding your activities.<br /><strong>Your attention is required</strong><br /></div><div style="background-color: #F3F3F3;border-bottom: solid 1px #E1E1E1;padding: 10px 0;"><div style="font-size: 20px;">Item 1</div><div style="color: #0066FF;font-size: 16px;">Booking Requested</div><div style="font-size: 14px;">Made by xxxx for 17:30 on Tue, Mar 13th 2012</div></div><div style="background-color: #F3F3F3;border-bottom: solid 1px #E1E1E1;padding: 10px 0;"><div style="font-size: 20px;">Item 2</div><div style="color: #0066FF;font-size: 16px;">Booking Requested</div><div style="font-size: 14px;">Made by xxxx for 18:15 on Tue, Mar 6th 2012</div></div><br /><br /><a href="#" style="background-color: #99CC33;border: solid 1px #64A100;border-radius: 7px;color: #fff;margin: 3px 2px 3px 2px;padding: 7px 10px;text-align: center;text-decoration: none;cursor: pointer;cursor: hand;">Login</a></div></body></html>
交付给:xxx@gmail.com
收到日期:2015年10月220日,SMTP id为xxxxxxxxx;
2012年2月20日星期一10:41:39-0800(太平洋标准时间)
收到日期:10.180.90.225,SMTP id xxxxxxxxx;
2012年2月20日星期一10:41:39-0800(太平洋标准时间)
返回路径:
收到:来自XXXXXXXX.net(xxxxxxxxx.net。[xxx.xxx.xxx.xxx])
通过mx.google.com使用ESMTPS id xxxxxxxxx
(版本=TLSv1/SSLv3密码=其他);
2012年2月20日星期一10:41:39-0800(太平洋标准时间)
接收到的SPF:通过客户端ip=xxx.xxx.xxx.xxx;
认证结果:mx.google.com;spf=pass smtp.mail=xxxxxxxxx.net
接收:从XXXXXXXX通过xxxxxxxxx.net与本地(Exim 4.69)发送
(信封来自)
身份证号xxxxxxxxx
对于xxxxxxxxx@xxxxxxxxx.com; 2012年2月20日星期一18:41:34+0000
致:xxxxxxxxx@gmail.com
主题:电子邮件主题
X-PHP-Script:xxxxxxxxx.co.uk/cronjob.PHP for xxx.xxx.xxx.xxx
发件人:xxxxxxxx
MIME版本:1.0
内容类型:text/html;字符集=ISO-8859-1
内容传输编码:引用可打印
消息Id:
日期:2012年2月20日星期一18:41:34+0000
X-反虐待:添加此标题是为了跟踪虐待行为,请将其包含在任何虐待报告中
X-Anti滥用:主主机名-xxxxxxxx.net
X-反滥用:原始域名-gmail.com
X-反滥用:发起人/呼叫者UID/GID-[1119 32003]/[47 12]
X-Anti滥用:发件人地址域-xxxxxxxxx.net
X-Source:/usr/local/lsws/fcgi-bin/lsphp-5.2.17
X-Source-Args:lsphp5:dig/public_html/xxxxxxxxx/cronjob.php
X-Source-Dir:xxxxxxxxx.co.uk:/public\u html
您好,xxxx,

这里是关于您活动的最近互动的每日摘要。
需要您的关注
项目1 xxxx于2012年3月13日星期二17:30预订项目2 xxxx于2012年3月6日星期二18:15预订项目

电子邮件的样式设置非常有限,接受的规则很少,通常您将其设置为内联样式

Html电子邮件模板:

电子邮件中的CSS支持:

很抱歉,如果我误解了这个问题,如果是,请告诉我。

我不知道这是原因,因为不同的邮件客户端和网络邮件会有不同的解释,但根据;所以你可能会在某个时候遇到问题

  • 正文中的字符行必须限制为998个字符, 并且应限制为78个字符,不包括CRLF
我计算您的HTML行的长度为1494个字符,因此您必须将其至少包装到两行

您通常会看到80个字符的行(包括CRLF),但这主要是为了显示(可追溯到计算机显示器的分辨率明显较低的时候)。1000个字符(包括CRLF)的限制更为重要


还要确保使用CRLF分隔每一行。

对不起,我是个傻瓜,我忘记了
样式=
,您需要将
3D
写入。现在工作得很好。

听起来你没有进行任何多部分分离-编辑你的问题以添加代码你是否尝试发送纯文本邮件。。。“情况是一样的吗?”亚当,我试过了,但当它出现时,它被当作纯文本处理。