0

mail()Postfix MTA 経由の関数を使用して、PHP で自動通知システムを作成しました。ただし、Outlook、実際には Exchange Server のユーザーは、行末に等しい「=」文字が表示され、HTML が壊れた通知を受け取ります。

Exchange Server はhtml/textを認識しましたが、「ソフト改行」または quoted-printable のデコードまたは解析に問題がありますか? この問題を解決するにはどうすればよいですか?

私が使用しているエンコーディングとスキーマは次のとおりです。

MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="8-10000000000-10000000000:87141"
Message-Id: <20130218130031.E9923D98115@diplo-www>
Date: Mon, 18 Feb 2013 14:00:31 +0100 (CET)

--8-10000000000-10000000000:87141
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

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

--8-10000000000-10000000000:87141--

これは元のボディです:

MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="8-10000000000-10000000000:87141"

--8-10000000000-10000000000:87141
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=0A=0A=0A=0A       NOTIFICATION=0A=0A  =0A    A new post was added  in:=0A=
=09IGCBP11 Europe 123=0A=0A    =0A=09=09Test 4 - exchange server header=0A=
=0A=09=09=0A=09This is test mail. It should be html/text formated via quote=
d-printable encoding.=0A=0A    =0A=09=09Author: Branislav Kurbalija=0A=0A=
=09Reply online=0A=09=0A=0A=09=0A=09=09To change your account properties or=
=0A=09=09password go to preferences=0A=09=0A=09=09www.diplomacy.edu=0A=09=
=0A=0A  =0A=09=09=09=09=09=0A=09This=0A=09is an automatically generated e-m=
ail notification.Please do not=0A=09respond by e-mail as your message will =
not be read.=09=09=09=09=0A  =0A=0A=0A
--8-10000000000-10000000000:87141
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=0A<CENTER>=0A=0A<div style=3D"font-family: arial, sans-serif; font-size: 1=
4px; width:=0A  600px; border: 1px solid #666666; color: #333333;=0A  text-=
align: left; border-radius: 2px;">=0A       <div style=3D"background-color:=
#008191; color: #ffffff; height: 15px;=0A  padding: 20px; border-bottom: 1p=
x solid #666666; margin-bottom: 5px;">NOTIFICATION</div>=0A=0A  <div style=
=3D"padding: 20px;">=0A    A new post was added  in:<br>=0A=09<A HREF=3D"ht=
tp://wsrv05.diplomacy.edu/textus22/?class=3D1#87">IGCBP11 Europe 123</A><BR=
>=0A=0A    <div style=3D"font-weight: bold; margin: 20px 0px 10px 0px;">=0A=
=09=09Test 4 - exchange server header</div>=0A=0A=09=09<p>=0A=09This is<str=
ong> test mail</strong>. It should be <span style=3D"background-color:yello=
w;">html/text</span> formated via quoted-printable encoding.</p>=0A=0A    <=
div style=3D"color: #525252; margin-top: 10px; text-align: right;">=0A=09=
=09Author: Branislav Kurbalija</div>=0A=0A=09<a href=3D"http://wsrv05.diplo=
macy.edu/textus22/?class=3D1#87">Reply online</a>=0A=09<hr>=0A=0A=09<div st=
yle=3D"font-size: 11px; float: left;">=0A=09=09To change your account prope=
rties or=0A=09=09password go to <A HREF=3D"http://wsrv05.diplomacy.edu/text=
us22/cantina/profile.php?user=3D941&class=3D1">preferences</A></div>=0A=09<=
div style=3D"font-size: 11px; float: right;">=0A=09=09<A HREF=3D"http://www=
.diplomacy.edu/">www.diplomacy.edu</a>=0A=09</div>=0A=0A  </div>=0A=09=09=
=09=09=09=0A=09<div style=3D"font-size: 11px; background-color:#eee; height=
: 24px;=0A=09  padding: 7px; margin-top: 20px; border-top: 1px solid #66666=
6; text-align: center;">This=0A=09is an automatically generated e-mail noti=
fication.<br>Please do not=0A=09respond by e-mail as your message will not =
be read.</div>=09=09=09=09=0A  =0A</div>=0A</CENTER>=0A
--8-10000000000-10000000000:87141--
4

1 に答える 1

1

quoted_printable_encode()MS Outlookに問題があります ( https://github.com/php/php-src/pull/120を参照)。そのため、php をアップグレードするか、quoted-printable を自分で実装するか、代わりに base64 を使用する必要があります。

于 2013-02-18T13:31:32.467 に答える