PHP の mail() 関数を使用して送信する電子メールの文字設定に問題があります。
PHPコードを書いた実際のファイルはUTF-8文字セットです。また、電子メールのヘッダーに charset=UTF-8 が設定されていることも確認しました。基本的な HTML コンテンツのヘッダーにメタ タグも追加しました。それでも、うまくいきません。
PHPコードは次のようになります。
// Prepare the e-mail to the GUEST
$to = $email;
$subject = "PÅMINNELSE: Bekräfta registrering för Event";
// Defining the headers
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
$headers .= "From: Pre-registration <event@adomain.com>" . "\r\n";
include("gemailreminder.php");
// Send the mail now!
mail($to, $subject, $message, $headers);
含まれているファイル gemmailreminder.php の内容は次のようになります。
<?php
$message = <<< MESSAGE
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>REMINDER E-MAIL</title>
</head>
<body>
<p >text...</p >
</body>
</html>
MESSAGE;
?>
この問題の解決に役立つ提案はありますか?
前もって感謝します!
//アンドレアス