2012-09-18 4 views
4

CMS를 개발했으며 사용자가 암호를 잊어 버리면 시스템에서 새로운 임의의 암호를 생성하여 전자 메일을 통해 사용자에게 보냅니다. 그러나 전자 메일을 열면 자동으로 문자가 제거됩니다 내 이메일 본문에서 (=)로 바꿉니다. Codeigniter는 HTML에서 문자를 제거합니다.

후 이메일 자사의이 리스팅 했다 SE 당신에게 = t 암호가 될이 있음을 알리기 위해 = N 굵게

친애 누르 Shirzai에 엉망이 부분을 볼 수 있습니다 전송 재설정. 벨로는 새 암호입니다 : 사용자 이름은 다음과 같습니다 IOODiGhcYYrL =이 피하기 위해 에서 시스템에 즉시 로그인로 < = trong> 새 암호를 변경하십시오가 새 파 = 단어를 모 히브에 보안 문제가 있습니다.

참고 : 순수 PHP 메일 기능으로 보내면 잘 작동합니다. 정말 내가 얻을 어떤 도움을 주셔서 감사합니다

:

울부 짖는 소리가 내 이메일 기능과 이메일 구성 파일의 코드입니다. 감사

메일 보내

내 기능을 다음과

if (! function_exists('send_password')) 
{ 
    function send_password($user_info, $password) 
    { 
     $CI =& get_instance(); 

     $username   = $user_info['username']; 
     $name    = $user_info['firstname'].' '.$user_info['lastname']; 
     $email    = $user_info['email']; 

     $subject   = 'Your New Password : Noor CMS |'.$CI->config->item('site_name'); 
     //email body 
     $message   = ''; 

     $message   .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; 
     $message   .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'; 
     $message   .= '<meta content="text/html; charset=utf-8" http-equiv="Content-type">'; 
     $message   .= '<head>'; 
     $message   .= '<title> Your New Password : Noor CMS | '.$CI->config->item('site_name').' </title>'; 
     $message   .= '</head>'; 
     $message   .= '<body>'; 
     $message   .= 'Dear '.trim($name); 
     $message   .= 'This Email was sent to you in order to inform you that your <strong>Password</strong> has been reset.<br/>'; 
     $message   .= 'Bellow is your <strong> New Password :</strong><br/>'; 
     $message   .= 'Your <strong>Username </strong>is : <strong> '.trim($username).'</strong><br/>'; 
     $message   .= 'Your <strong>New Password </strong>is : <strong> '.trim($password).'</strong><br/>'; 
     $message   .= 'Please change your <strong>New Password</strong> as soon as you login to the system in order to avoid any security issues.<br/>'; 
     $message   .= '</body></html>'; 

     //prepare email and send 
     $CI->email->from($CI->config->item('admin_email'), $CI->config->item('admin_name')); 
     $CI->email->to($email); 
     $CI->email->subject($subject); 
     $CI->email->message($message); 

     if ($CI->email->send()) 
     { 
      return TRUE; 
     } 

     return FALSE; 
    } 
} 

그리고 email.php로 설정 파일입니다 같이 라인 길이를 자르고 시도

$config['useragent']   = 'NoorCMS'; 
$config['protocol']   = 'mail'; 
$config['mailpath']   = '/usr/sbin/sendmail'; 
$config['smtp_host']   = ''; 
$config['smtp_user']   = ''; 
$config['smtp_pass']   = ''; 
$config['smtp_port']   = 25; 
$config['smtp_timeout']   = 10; 
$config['wordwrap']   = FALSE; 
$config['wrapchars']   = 100; 
$config['mailtype']   = 'html'; 
$config['send_multipart']  = FALSE; 
$config['charset']   = 'utf-8'; 
$config['validate']   = FALSE; 
$config['priority']   = 1; 
$config['crlf']    = '\n'; 
$config['newline']   = '\n'; 
$config['bcc_batch_mode'] = FALSE; 
$config['bcc_batch_size']  = 200; 
+0

링크가 제공되지 않으면 도움이되지 않는다면 줄 길이 문제 일 수 있습니다. –

답변

0

가 다음을 수행하십시오

$message   = array(); 

    $message[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; 
    $message[] = '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'; 
    $message[] = '<meta content="text/html; charset=utf-8" http-equiv="Content-type">'; 
    $message[] = '<head>'; 
    $message[] = '<title> Your New Password : Noor CMS | '.$CI->config->item('site_name').' </title>'; 
    $message[] = '</head>'; 
    $message[] = '<body>'; 
    $message[] = 'Dear '.trim($name); 
    $message[] = 'This Email was sent to you in order to inform you that your <strong>Password</strong> has been reset.<br/>'; 
    $message[] = 'Bellow is your <strong> New Password :</strong><br/>'; 
    $message[] = 'Your <strong>Username </strong>is : <strong> '.trim($username).'</strong><br/>'; 
    $message[] = 'Your <strong>New Password </strong>is : <strong> '.trim($password).'</strong><br/>'; 
    $message[] = 'Please change your <strong>New Password</strong> as soon as you login to the system in order to avoid any security issues.<br/>'; 
    $message[] = '</body></html>'; 

    $message = implode(PHP_EOL, $message); 
6

이 문제가 발생했습니다. 이메일 주소를 업데이트해야합니다.

$config['newline'] = "\r\n"; 
$config['crlf'] = "\r\n"; 
+0

고마워 친구, 내 문제를 해결했습니다. –

관련 문제