<?php
header('Content-type: text/html; charset=utf-8');
$string = '%u0391%u03b8%u03b1%u03bd%u03b1%u03c3%u03af%u03bf%u03c5';
$string = preg_replace('/%u([0-9a-f]+)/', '&#x$1;', $string);
echo html_entity_decode($string, ENT_COMPAT, 'UTF-8');
$arr = [
'to_email' => '[email protected]',
'from_email' => '[email protected]',
'subject' => 'utf',
'message' => $string
];
mail_send($arr);
function mail_send($arr)
{
if (!isset($arr['to_email'], $arr['from_email'], $arr['subject'], $arr['message'])) {
throw new HelperException('mail(); not all parameters provided.');
}
$to = empty($arr['to_name']) ? $arr['to_email'] : '"' . mb_encode_mimeheader($arr['to_name']) . '" <' . $arr['to_email'] . '>';
$from = empty($arr['from_name']) ? $arr['from_email'] : '"' . mb_encode_mimeheader($arr['from_name']) . '" <' . $arr['from_email'] . '>';
$headers = array
(
'MIME-Version: 1.0',
'Content-Type: text/html; charset="UTF-8";',
'Content-Transfer-Encoding: 7bit',
'Date: ' . date('r', $_SERVER['REQUEST_TIME']),
'Message-ID: <' . $_SERVER['REQUEST_TIME'] . md5($_SERVER['REQUEST_TIME']) . '@' . $_SERVER['SERVER_NAME'] . '>',
'From: ' . $from,
'Reply-To: ' . $from,
'Return-Path: ' . $from,
'X-Mailer: PHP v' . phpversion(),
'X-Originating-IP: ' . $_SERVER['SERVER_ADDR'],
);
mail($to, '=?UTF-8?B?' . base64_encode($arr['subject']) . '?=', $arr['message'], implode("\n", $headers));
}
을 울리는 전에
header('Content-type: text/html; charset=utf-8');
을이
이 좋은 답변 –
있다가 작업 해 주셔서 감사합니다 이메일 브라우저와 이메일
Αθανασίου
에서Αθανασίου
을 인쇄합니다 나를. –작동하지만 이메일 템플릿에 보낼 때 이메일에 제대로 표시되지 않습니다. –