0

我正在使用 PHP 生成精美的 HTML 电子邮件以发送给访问者,但出于某种原因,某些访问者说 HTML 不适合他们(看到的是 RAW HTML 而不是漂亮的电子邮件)。

我没有将其缩小到某个客户,但是在与他们交谈后,他们说他们可以接收其他 HTML 电子邮件,所以这是我做错的事情......

我的PHP代码如下

$to = 'jm391@le.ac.uk';
$subject = 'Daily Update - New Bikes Matching Your Alerts';
$headers = "From: john@findthatbike.co.uk\r\n";
$headers .= "Reply-To: john@findthatbike.co.uk\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";


if (mail($to, $subject, $message, $headers)) {
    echo 'Your message has been sent<br/>';
} else {
    echo 'There was a problem sending the email.<br/>';
}

我的 $message 变量加载了以下链接 HTML 源

http://www.findthatbike.co.uk/sampleemail.html

我的客户向我转发了一封无效的电子邮件,转发的部分如下所示,我被告知他收到了其他人的 HTML 电子邮件,所以真的不知道该尝试什么...

From: john@findthatbike.co.uk [mailto:john@findthatbike.co.uk] 
Sent: 05 April 2013 08:35
To: XXXXX XXXXX
Subject: Daily Update - New Bikes Matching Your Alerts

Reply-To: john@findthatbike.co.uk

MIME-Version: 1.0

Content-Type: text/html; charset=ISO-8859-1
Message-Id: <20130405073022.8597D9CF79D@MY SERVER ADDRESS>
Date: Fri,  5 Apr 2013 08:30:22 +0100 (BST)
X-invURIBL-Scan: Scanned by invURIBL 3.1.1 on 05/04/2013 08:34:17
X-invURIBL-Weight: 0
X-invURIBL-Range: CLEAN
X-Declude-Sender: MY SERVER NAME [MY SERVER IP]
X-Declude-Spoolname: 72086847.eml
X-Declude-RefID: 
X-MessageStream-Note: Scanned by MessageStream (www.messagestream.com).
X-MessageStream-Scan: Score [0] at 08:34:29 on 05 Apr 2013
X-MessageStream-Tests: Whitelisted
X-Country-Chain: UNITED KINGDOM->destination


        <html>
        <body style="background:url('http://findthatbike.co.uk/images/bg3.jpg') repeat fixed 0 0 #EEEEEE; padding-top: 10px; padding-bottom: 10px;">
4

0 回答 0