CI 묻고 답하기

제목 아이폰 이메일 제목 글자 깨짐 현상
글쓴이 이현석 작성시각 2012/03/21 11:07:39
댓글 : 3 추천 : 1 스크랩 : 0 조회수 : 24581   RSS
 CI의 email 클래스를 이용해서 메일을 발송하고 있습니다.

그런데, 다른 기기에선 다 잘 보이는데 유독 아이폰에서는 글자의 일부가 깨져서 보입니다.

그것도 제목에 있는 글자만 깨집니다..

혹시 원인을 아시는 분 계실까요? ㅠㅠ



 다음글 [CI 기본] 헬퍼와 라이브러리 용도 차이? (3)
 이전글 [초보]라우팅질문 (6)

댓글

변종원(웅파) / 2012/03/21 18:05:55 / 추천 0
전에 다른 곳에서 본 기억이 있는데 구글 검색하면 답이 있을 겁니다.
동일한 현상을 본 적이 있습니다.
카프리카 / 2012/05/23 18:30:43 / 추천 0
CI 버그입니다. 

그래서   system/libraries/Email.php 의 subject 함수를 아래와 같이 수정해서 쓰고 있습니다.
단 utf-8 일때만 수정하셔야 합니다.

public function subject($subject)
 {
  // utf-8  제목 버그가 있어서 수정
  $subject='=?UTF-8?B?' . base64_encode ( $subject ) . '?='; 
  //$subject = $this->_prep_q_encoding($subject);
  $this->_set_header('Subject', $subject);
  return $this;
 }

배강민 / 2012/05/23 22:41:11 / 추천 0
 전 email helper를 오버라이딩해서

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Send an email
 *
 * @access public
 * @return bool
 */
if ( ! function_exists('send_email'))
{
 function send_email($recipient, $subject = 'Test email', $message = 'Hello World')
 {
  //한글 깨져서 아래 header, subject (base64_encode) 추가해서 오버라이딩
  $header = "MIME-Version: 1.0\r\n";
  $header .= "Content-Type: text/html; charset=utf-8\r\n";

  $subject = '=?UTF-8?B?'.base64_encode($subject)."?=\n";

  return mail($recipient, $subject, $message, $header);
 }
}


/* End of file email_helper.php */
/* Location: ./system/helpers/email_helper.php */

으로 application/helpers/MY_email_helper.php 로 넣어서 처리했습니다.