1

我通过 codeigniter 发送电子邮件,hotmail 收件人收到一封看似空的电子邮件。在此处输入图像描述

但是,如果您显示来源,则主体是完整的:

    x-store-info:sbevkl2QZR7OXo7WID5ZcdV2tiiWGqTnL8LqRHZDpO1a6RfqJUb9Bvk56X3BJKAg6cjaVhmE0UEtHLPiBFT8cnf1LZrSPERjUEe8skwDm3KAgvehRwVK6+cJhj4xrCbMEtL9MZV6cCY=
Authentication-Results: hotmail.com; sender-id=pass (sender IP is 89.31.151.18) header.from=webmaster@biocoupons.fr; dkim=none header.d=biocoupons.fr; x-hmca=pass
X-SID-PRA: webmaster@biocoupons.fr
X-DKIM-Result: None
X-Message-Status: n:0:n
X-SID-Result: Pass
X-AUTH-Result: PASS
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MTtHRD0xO1NDTD0w
X-Message-Info: NhFq/7gR1vRbK5wwd2CCPiz2FoG/apC9Nlwn9QDQUkFtCAY0+3pBZaTO9tRcEil5WQ1UlFPTmVO6YI0VFRvEqJtfBxGnyrZjARsdKFYGzasctOU2tO5XGDWuESbcCr0Hq4XO6B1tyQE=
Received: from brunetprod.nexen.net ([89.31.151.18]) by SNT0-MC3-F43.Snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900);
     Tue, 15 May 2012 23:44:54 -0700
Received: by brunetprod.nexen.net (Postfix, from userid 33)
    id 9DB1030C00A; Wed, 16 May 2012 08:44:53 +0200 (CEST)
To: ecolehaiti@live.fr
Subject: =?utf-8?Q?Vous_avez_oubli=c3=a9_votre_mot_de_passe_sur_Bio_Coupons=3f?=
X-PHP-Script: www.biocoupons.fr/index.php/auth/forgot_password for 81.56.219.94
User-Agent: CodeIgniter
Date: Wed, 16 May 2012 08:44:53 +0200
From: "Bio Coupons" <webmaster@biocoupons.fr>
Reply-To: "Bio Coupons" <webmaster@biocoupons.fr>
X-Sender: webmaster@biocoupons.fr
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <4fb34ce591593@biocoupons.fr>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4fb34ce59161d"
Return-Path: webmaster@biocoupons.fr
X-OriginalArrivalTime: 16 May 2012 06:44:54.0956 (UTC) FILETIME=[671596C0:01CD332F]

This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_4fb34ce59161d
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Bonjour,

Vous avez perdu votre mot de passe ? Pas de panique. 
Pour créer un nouveau mot de passe, cliquez sur le lien suivant :

http://www.biocoupons.fr/auth/reset_password/
Vous recevez cet email à la demande d'un utilisateur de Bio Coupons . C'est
une étape de la création d'un nouveau mot de passe sur le site. Si vous
N'AVEZ PAS demandé un nouveau mot de passe, merci d'ignorer cet email, et
votre mot de passe restera inchangé.

Merci,
L'équipe Bio Coupons


--B_ALT_4fb34ce59161d
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html>
<head><title>Création d'un nouveau mot de passe sur Bio Coupons</title></h=
ead>
<body>
<div style=3D"max-width: 800px; margin: 0; padding: 30px 0;">
<table width=3D"80%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
<tr>
<td width=3D"5%"></td>
<td align=3D"left" width=3D"95%" style=3D"font: 13px/18px Arial, Helvetica,=
 sans-serif;">
<h2 style=3D"font: normal 20px/23px Arial, Helvetica, sans-serif; margin: 0=
; padding: 0 0 18px; color: black;">Créer un nouveau mot de passe</h2>
Vous avez perdu votre mot de passe ? Pas de panique. <br />
Pour créer un nouveau mot de passe, cliquez sur le lien suivant :<br />
<br />
<big style=3D"font: 16px/18px Arial, Helvetica, sans-serif;"><b><a href=3D"=
http://www.biocoupons.fr/auth/reset_password/" style=3D"color: #3366cc;">Créer un nouveau mot de passe</a></b></=
big><br />
<br />
Le lien ne marche pas ? Copiez le lien suivant dans la barre d'adresse de v=
otre navigateur :<br />
<nobr><a href=3D"http://www.biocoupons.fr/auth/reset_password/" style=3D"color: #3366cc;">http://www.biocoupons.f=
r/auth/reset_password/</a></nobr><br /=
>
<br />
<br />
Vous recevez cet email à la demande d'un utilisateur de <a href=3D"http://=
www.biocoupons.fr/" style=3D"color: #3366cc;">Bio Coupons</a>. C'est une é=
tape de la création d'un nouveau mot de passe sur le site. Si vous N'AVEZ =
PAS demandé un nouveau mot de passe, merci d'ignorer cet email, et votre m=
ot de passe restera inchangé.<br />
<br />
<br />
Merci,<br />
L'équipe Bio Coupons</td>
</tr>
</table>
</div>
</body>
</html>

--B_ALT_4fb34ce59161d--

另一个邮件程序显示电子邮件正常。我尝试使用和不使用 doctype。

呈现的 HTML:

    <div id="mpf0_readMsgBodyContainer" class="ReadMsgBody" onclick="return Control.invoke('MessagePartBody','_onBodyClick',event,event);">
        <div class="SandboxScopeClass ExternalClass" id="mpf0_MsgContainer"></div>

以及正确电子邮件的呈现 html(文本)

    <div id="mpf0_readMsgBodyContainer" class="ReadMsgBody" onclick="return Control.invoke('MessagePartBody','_onBodyClick',event,event);">
    <div class="SandboxScopeClass ExternalClass PlainTextMessageBody ContentFiltered" id="mpf0_MsgContainer">
        <pre>Bonjour,<br>Vous venez de vous inscrire à Bio Coupons et nous vous en remercions.<br> 
        </pre>
    </div>
</div>

如您所见,消息正文 div 根本没有填充。我怀疑是 javascript 问题,但为什么它会出现在我的电子邮件中?谢谢你的帮助

4

2 回答 2

3

它只是在 html 代码的顶部缺少一个新行。IE :

--B_ALT_4fb34ce59161d
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable


<html>
...

代替

--B_ALT_4fb34ce59161d
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html>
...

很好奇,不是吗?

于 2012-05-16T18:07:22.330 回答
1

我们在 Web 应用程序中遇到了这个问题,我发现 CSS 注释是我们环境中的罪魁祸首。在尝试上述解决方案均未成功后,我开始逐行、逐节剖析我们的 HTML 模板。

在我们的环境中,我们使用 PreMailer.net ( https://github.com/milkshakesoftware/PreMailer.Net ) 从普通样式表中内联我们的 CSS 样式,并通过部分将其注入 HTML 电子邮件模板。在那些部分 CSS 文件中,有 CSS 注释。当我删除这些邮件时,Outlook.com Web 客户端(它还为@hotmail 和@live 帐户提供邮件服务)中正确呈现了电子邮件。

在我们的应用程序中,我将 CSS 注释从/* */服务器端注释更改为@* *@(我们正在为我们的 .NET MVC 4 应用程序使用剃刀语法),这样就成功了。

于 2014-02-03T19:27:08.933 回答