<META content="text/html; charset=UTF-8" http-equiv=Content-Type>
태그 에 적절하게 설정된 레이아웃을 사용하여 Zend Framework 2를 사용하여 이메일을 보내고 있습니다 <head>
.
이메일 내용에 IP 주소가 포함된 링크를 넣으면 Outlook(365 버전)에서 문자 집합 인식이 제대로 중단되고 이메일이 서유럽(Windows) 인코딩으로 표시됩니다.
물론 작업 -> 기타 작업 -> 인코딩을 UTF-8로 변경하면 제대로 표시됩니다.
Outlook에서 이메일을 UTF-8로 표시하도록 강제하는 방법을 알고 계십니까?
IP 주소를 포함하지 않도록 링크를 변경하면 Outlook에서 UTF-8 인코딩을 올바르게 인식하지만 유일한 문제는 링크에 IP 주소가 포함되어 있을 때입니다. 방법
에만 문제가 있음을 확인했지만 $this->serverurl()
IP 주소가 하드코딩되어 있으면 효과는 동일합니다. UTF-8을 인식하지 못합니다.
이메일 내용(레이아웃 없음):
<?php
echo sprintf(
$this->translate('scp.notification.done'),
'<a href="'.$this->serverurl() . $this->url('system-change-proposal/view', array('id' => $this->id)) . '">' . $this->info['PROPOSAL_NUMBER'] . '</a><br/>',
$this->info['CREATE_DATE'] . '<br/>',
$this->info['TOPIC'] . '<br/>',
$this->info['CONTENT']
);
?>
이메일은 다음과 같이 표시됩니다(깨진 폴란드어 발음 구별 문자가 있는 폴란드어 언어).
우와가. WiadomoÅ>ā‡ pochodzi z serwera DEWELOPERSKIEGO ZPB – prosimy jā… zignorować! DzieÅ“ dobry, zrealizowaliÅ>my Twój wniosek o zmiany w ZPB o nr 2019/2 z dnia 2019-08-13 12:43:32 TytuÅ‚: test TreÅ��‡: testujemy różne rzeczy Jeżeli masz pytania dot. realizacji wniosku proszä™ o kontakt z 헬프 데스크 nr 전화 xxx xxx xxx
이메일의 전체 HTML:
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Simple Transactional Email</title>
<style>
/* -------------------------------------
GLOBAL RESETS
------------------------------------- */
img {
border: none;
-ms-interpolation-mode: bicubic;
max-width: 100%; }
body {
background-color: #f6f6f6;
font-family: sans-serif;
-webkit-font-smoothing: antialiased;
font-size: 14px;
line-height: 1.4;
margin: 0;
padding: 0;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%; }
table {
border-collapse: separate;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
width: 100%; }
table td {
font-family: sans-serif;
font-size: 14px;
vertical-align: top; }
/* -------------------------------------
BODY & CONTAINER
------------------------------------- */
.body {
background-color: #f6f6f6;
width: 100%; }
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
.container {
display: block;
Margin: 0 auto !important;
/* makes it centered */
max-width: 800px;
padding: 10px;
width: 800px; }
/* This should also be a block element, so that it will fill 100% of the .container */
.content {
box-sizing: border-box;
display: block;
Margin: 0 auto;
max-width: 800px;
padding: 10px; }
/* -------------------------------------
HEADER, FOOTER, MAIN
------------------------------------- */
.main {
background: #fff;
border-radius: 3px;
width: 100%; }
.wrapper {
box-sizing: border-box;
padding: 20px; }
.footer {
clear: both;
padding-top: 10px;
text-align: center;
width: 100%; }
.footer td,
.footer p,
.footer span,
.footer a {
color: #999999;
font-size: 12px;
text-align: center; }
/* -------------------------------------
TYPOGRAPHY
------------------------------------- */
h1,
h2,
h3,
h4 {
color: #000000;
font-family: sans-serif;
font-weight: 400;
line-height: 1.4;
margin: 0;
Margin-bottom: 30px; }
h1 {
font-size: 35px;
font-weight: 300;
text-align: center;
text-transform: capitalize; }
p,
ul,
ol {
font-family: sans-serif;
font-size: 14px;
font-weight: normal;
margin: 0;
Margin-bottom: 15px; }
p li,
ul li,
ol li {
list-style-position: inside;
margin-left: 5px; }
a {
color: #3498db;
text-decoration: underline; }
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-justify {
text-align: justify;
}
.text-nowrap {
white-space: nowrap;
}
.table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0.5em;
}
.zpb-table th {
padding:7px;
padding-top:4px;
padding-bottom:4px;
font-weight:bold;
text-align:center;
background-color:#F6F6F6;
border-right: 1px solid #D2E9EF;
box-shadow: 0px 2px 5px #888888;
}
.zpb-table td {
vertical-align: middle !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert-warning {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
/* -------------------------------------
BUTTONS
------------------------------------- */
.btn {
box-sizing: border-box;
width: 100%; }
.btn > tbody > tr > td {
padding-bottom: 15px; }
.btn table {
width: auto; }
.btn table td {
background-color: #ffffff;
border-radius: 5px;
text-align: center; }
.btn a {
background-color: #ffffff;
border: solid 1px #3498db;
border-radius: 5px;
box-sizing: border-box;
color: #3498db;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: bold;
margin: 0;
padding: 12px 25px;
text-decoration: none;
}
.btn-primary table td {
background-color: #3498db; }
.btn-primary a {
background-color: #3498db;
border-color: #3498db;
color: #ffffff; }
/* -------------------------------------
OTHER STYLES THAT MIGHT BE USEFUL
------------------------------------- */
.last {
margin-bottom: 0; }
.first {
margin-top: 0; }
.align-center {
text-align: center; }
.align-right {
text-align: right; }
.align-left {
text-align: left; }
.clear {
clear: both; }
.mt0 {
margin-top: 0; }
.mb0 {
margin-bottom: 0; }
.preheader {
color: transparent;
display: none;
height: 0;
max-height: 0;
max-width: 0;
opacity: 0;
overflow: hidden;
mso-hide: all;
visibility: hidden;
width: 0; }
.powered-by a {
text-decoration: none; }
hr {
border: 0;
border-bottom: 1px solid #f6f6f6;
Margin: 20px 0; }
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
/* -------------------------------------
RESPONSIVE AND MOBILE FRIENDLY STYLES
------------------------------------- */
@media only screen and (max-width: 620px) {
table[class=body] h1 {
font-size: 28px !important;
margin-bottom: 10px !important; }
table[class=body] p,
table[class=body] ul,
table[class=body] ol,
table[class=body] td,
table[class=body] span,
table[class=body] a {
font-size: 16px !important; }
table[class=body] .wrapper,
table[class=body] .article {
padding: 10px !important; }
table[class=body] .content {
padding: 0 !important; }
table[class=body] .container {
padding: 0 !important;
width: 100% !important; }
table[class=body] .main {
border-left-width: 0 !important;
border-radius: 0 !important;
border-right-width: 0 !important; }
table[class=body] .btn table {
width: 100% !important; }
table[class=body] .btn a {
width: 100% !important; }
table[class=body] .img-responsive {
height: auto !important;
max-width: 100% !important;
width: auto !important; }}
/* -------------------------------------
PRESERVE THESE STYLES IN THE HEAD
------------------------------------- */
@media all {
.ExternalClass {
width: 100%; }
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%; }
.apple-link a {
color: inherit !important;
font-family: inherit !important;
font-size: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
text-decoration: none !important; }
.btn-primary table td:hover {
background-color: #34495e !important; }
.btn-primary a:hover {
background-color: #34495e !important;
border-color: #34495e !important; } }
</style>
</head>
<body class="">
<table border="0" cellpadding="0" cellspacing="0" class="body">
<tr>
<td> </td>
<td class="container">
<div class="content">
<table class="main">
<tr>
<td>
<span style="color: #ee0000; font-size: 17px;">
UWAGA. Wiadomość pochodzi z serwera DEWELOPERSKIEGO ZPB – prosimy ją zignorować! </span>
</td>
</tr>
<tr>
<td class="wrapper">Dzień dobry, zrealizowaliśmy Twój wniosek o zmiany w ZPB o nr <a href="http://zpb//scp/view/5613">2019/2</a><br/> z dnia 2019-08-13 12:43:32<br/> Tytuł: test<br/> Ttreść: testujemy różne rzeczy Jeżeli masz pytania dot. realizacji wniosku proszę o kontakt z Help Desk nr tel xxx xxx xxx<br/>
</td>
</tr>
</table>
</div>
</td>
<td> </td>
</tr>
</table>
</body>
</html>
프로덕션 서버에서는 $this->serverurl()
일반 주소를 출력하지만 테스트 서버에서는 항상 IP 주소를 출력하므로 인코딩 인식이 중단되어서는 안 됩니다(현재는 중단하고 있음).
확인해 보니 웹메일에서는 문제가 Outlook과 동일하지만 Gmail에서는 제대로 표시됩니다.
어쩌면 IMAP 서버 구성 문제일 수 있습니까? 나는 그런 것들에 대해 아무것도 모른다.
나는 Stackoverflow에 대해 동일한 질문을 했지만 고려한 후에 여기에 더 적합하다고 생각합니다.
Outlook 이메일 속성에서 가져온 전체 헤더:
Received: from 195.245.224.194 (HELO mx-1.tauron.pl) (195.245.224.194)
by 94.152.180.72 with SMTP; 20 Aug 2019 07:27:18 -0000
Received: (qmail 43535 invoked by uid 1272007); 20 Aug 2019 07:27:18 -0000
Received: from poczta.tpe.corp (10.170.11.93) by
TPCE-EXCA01V-TD-ZPB-new-version.tpe.corp (10.170.6.50) with Microsoft SMTP
Server id 14.3.408.0; Tue, 20 Aug 2019 09:27:14 +0200
Received: from unknown (HELO poczta.tpe.corp) ([10.170.6.40])
by mx-1.tauron.pl with ESMTP; 20 Aug 2019 09:27:15 +0200
From: "TD Zarzadzanie Praca Brygad" <[email protected]>
To: <[email protected]>
Subject: Zrealizowano wniosek o zmiany 2019/2
Date: Tue, 20 Aug 2019 09:27:14 +0200
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0000_01D5573A.4D3DE7C0"
X-Mailer: Microsoft Outlook 16.0
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on 3010302.s.tld.pl
X-Spam-Flag: YES
X-Spam-Level: *******
X-Spam-Report: =?ISO-8859-1?Q?
* -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at
* https://www.dnswl.org/, no trust
* [195.245.224.194 listed in list.dnswl.org]
* -1.5 BAYES_00 BODY: Bayesowskie prawdopodobie=f1stwo spamu wynosi 0 do
* 1%
* [score: 0.0000]
* -0.1 SPF_HELO_PASS SPF: HELO matches SPF record
* 8.1 WEIRD_PORT URI: U=bfywa niestandardowego numeru portu dla HTTP
* 0.7 MIME_HTML_ONLY BODY: Wiadomo=b6=e6 posiada tylko cz=ea=b6ci
* tekstowe/html MIME
* 0.0 HTML_MESSAGE BODY: Wiadomo=b6=e6 zawiera kod HTML?=
X-Spam-Relay-Country: PL ** **
X-IronPort-AV: E=Sophos;i="5.64,408,1559512800";
d="scan'208,217";a="76099017"
X-IronPort-AV: E=McAfee;i="6000,8403,9354"; a="76099017"
X-C2ProcessedOrg: 5199a320-9f4c-49ed-bc0e-d8ad42683a42
X-Spam-Status: Yes, score=7.2 required=5.0 tests=BAYES_00,HTML_MESSAGE, MIME_HTML_ONLY,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,WEIRD_PORT autolearn=disabled version=3.4.2
X-EsetId: 37303A29D5F1F66E61726A
Thread-Index: AQKbkkKOZgQGewYhh0xjSjHTj+sQ2w==
GMail의 '원본 메시지' 디스플레이에 표시되는 추가 정보:
MIME-Version: 1.0
Content-Type: text/html
Content-Transfer-Encoding: 8bit
From: "TD Zarządzanie Pracą Brygad" <[email protected]>
To: <[email protected]>
Subject: Zrealizowano wniosek o zmiany 2019/2
여기에는 인코딩에 관한 내용이 없으며 문자 세트는 <head>
메시지에만 설정됩니다.