폼메일 한글깨짐 문의합니다
본문
아래 사진이 메일받았을때 내용부분입니다..
제목은 한글로 잘 나옵니다 도움부탁드립니다
-----------코드부분 텍스트-----------
<?
//보내는 이
$recipient = "*** 개인정보보호를 위한 이메일주소 노출방지 ***";
//제목 처리
$subject = '=?UTF-8?B?'.base64_encode('[abc-홈페이지발송]').'?=';
//메일주소
$mail_from = '=?UTF-8?B?'.base64_encode($_GET['email']).'?=';
//메일내용
$mail_body = "<table width='600' border='0' cellpadding='0' cellspacing='1' bgcolor='#CCCCCC'><tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>이름</td>
<td width='400' bgcolor='#FFFFFF'>". $_GET['name']."</td></tr>".
" <tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>회사</td>
<td width='400' bgcolor='#FFFFFF'>". $_GET['company']."</td></tr>".
" <tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>연락처</td>
<td width='400' bgcolor='#FFFFFF'>". $_GET['phone']."</td></tr>".
" <tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>이메일</td>
<td width='400' bgcolor='#FFFFFF'>". $_GET['email']."</td></tr>".
" <tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>코멘트</td>
<td width='400' bgcolor='#FFFFFF'>".nl2br($_GET['comment'])."</td></tr>".
"</table>";
//메일 발송처리
$header = "From:$subject\n";
$header = "Content-Type: text/html;charset=UTF-8";
$header .= "From : $mail_from <".$mail_from.">\n";
$email = mail($recipient, $subject, $mail_body, $header);
if (!$email)
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <script>
window.alert('메일 발송이 실패하였습니다. ');
history.go(-1);
</script>";
else
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><script>
window.alert('메일이 정상적으로 발송되었습니다.');
history.go(-1);
</script>";
?>
답변 2
보내는 이 위에다가
$mailName= '=?UTF-8?B?'.base64_encode($_GET['name']).'?=';
$mailCompany= '=?UTF-8?B?'.base64_encode($_GET['company']).'?=';$mail_body = "<table width='600' border='0' cellpadding='0' cellspacing='1' bgcolor='#CCCCCC'><tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>이름</td>
<td width='400' bgcolor='#FFFFFF'>". $mailName."</td></tr>".
" <tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>회사</td>
<td width='400' bgcolor='#FFFFFF'>". $mailCompany."</td></tr>".
" <tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>연락처</td>
<td width='400' bgcolor='#FFFFFF'>". $mailPhone."</td></tr>".
" <tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>이메일</td>
<td width='400' bgcolor='#FFFFFF'>". $mail_from ."</td></tr>".
" <tr>
<td width='100' height='30' align='center' bgcolor='#eeeeee'>코멘트</td>
<td width='400' bgcolor='#FFFFFF'>".nl2br($mailComment)."</td></tr>".
"</table>";