테스트 사이트 - 개발 중인 베타 버전입니다

메일 수신했을때 한글 깨지는 현상 채택완료

폼메일 이용해서 메일 보내는것까진 문제없었는데

네이버메일을 제외한 타 메일주소로 수신했을때

한글로된 제목 및 파일명이 깨지는 현상이 발생합니다..

해결법 알려주시면 감사하겠습니다.

 

 

</strong></p>

<p>

// --- 헤더 --- //

$headers = "Return-Path: ".str_replace("\\", "", $femail)."\r\n";

$headers .= "From: ".str_replace("\\", "", $femail)."\r\n";

if($remail) {

    $headers .= "Cc: ".str_replace("\\", "", $remail)."\r\n";

}

if($hemail) {

    $headers .= "Bcc: ".str_replace("\\", "", $hemail)."\r\n";

}</p>

<p>if($attach_url && $attach_name) { // --- 첨부파일 --- //

    $filename=$attach_name;

    $fp = fopen($attach_url,"r");

    $file = fread($fp,$attach_size);

    fclose($fp);

    if ($attach_type == ""){

        $attach_type = "application/octet-stream";

    }

    // --- 헤더 --- //

    $headers .= "MIME-Version: 1.0\r\n";

    $headers .= "Content-Type: Multipart/mixed;charset=ISO-2022-KR, Content-Transfer-Encoding: 7bit; boundary=\"$boundary\"";

    // --- 본문 --- // 

    $mailbody = "This is a multi-part message in MIME format.\r\n\r\n";

    $mailbody .= "--$boundary\r\n";

    $mailbody .= "Content-Type: text/html; charset=utf-8\r\n";

    $mailbody .= "Content-Transfer-Encoding: base64\r\n\r\n";

    $mailbody .= chunk_split(base64_encode(str_replace("\\", "",$subject. "\r\n" .$s_date. "\r\n" .$add. "\r\n" .$u_name. "\r\n" .$u_tel. "\r\n"  .$b_date. "\r\n" .$message))) . "\r\n";

    // --- 첨부 --- // 

    $mailbody .= "--$boundary\r\n"; 

    $mailbody .= "Content-Type: ".$attach_type."; name=\"".$filename."\"\r\n";

    $mailbody .= "Content-Transfer-Encoding: base64\r\n";

    $mailbody .= "Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n";

    $mailbody .= base64_encode($file)."\r\n\r\n";

    $mailbody .= "--$boundary--";

}

else {

    // --- 헤더 --- // 

    $headers .= "MIME-Version: 1.0\r\n"; 

    $headers .= "Content-Type: Multipart/alternative; boundary = \"$boundary\"";

    // --- 본문 --- //

    $mailbody = "--$boundary\r\n"; 

    $mailbody .= "Content-Type: text/html; charset=utf-8\r\n";

    $mailbody .= "Content-Transfer-Encoding: base64\r\n\r\n";

    $mailbody .= chunk_split(base64_encode(str_replace("\\", "",$subject. "\r\n" .$s_date. "\r\n" .$add. "\r\n" .$u_name. "\r\n" .$u_tel. "\r\n"  .$b_date. "\r\n" .$message))) . "\r\n";

    $mailbody .= "--$boundary--\r\n\r\n"; 

}</p>

<p>$ret = mail($temail, $subject, $mailbody, $headers);</p>

<p>if(!$tit || !$u_name|| !$u_tel){

    alert('잘못된 접근입니다.');

    exit;

}</p>

<p>$file = "";</p>

<p><strong>

 

 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

보낼때 텍스트가 들어가는 공간을 iconv ("UTF-8", "EUC-KR", 변수) 로 처리해서 보내보세요.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인

전체 질문 목록