2014-04-14 4 views
0

최근에 기존 CodeIgniter 제품을 자체 VPS로 옮겼습니다. 모든 것이 사라졌습니다. 그러나 어떤 이유로 비밀번호가 무효화되었으며 forgot_password 기능이 실행되면 전자 메일에는 제목이 그대로 표시되지만 전자 메일에는 내용이 없습니다. 조금도. '( 출구 (('BASEPATH ')를 정의!)CodeIgniter/TankAuth forgot_password 함수가 내용이없는 이메일을 전송합니다.

<?php 

경우 :

function _send_email($type, $email, &$data) { 
     $this->load->library('email'); 
     $this->email->from($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth')); 
     $this->email->reply_to($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth')); 
     $this->email->to($email); 
     $this->email->subject(sprintf($this->lang->line('auth_subject_' . $type), $this->config->item('website_name', 'tank_auth'))); 
     $this->email->message($this->load->view('email/' . $type . '-html', $data, TRUE)); 

    echo $this->load->view('email/' . $type . '-html', $data, TRUE); 

     $this->email->set_alt_message($this->load->view('email/' . $type . '-txt', $data, TRUE)); 
     $this->email->send(); 
    } 

내가 같은 CodeIgniter의 라이브러리를 사용하여 이메일을 보내는 간단한 PHP 스크립트를 썼다 : 이것은 잘못된 코드 직접 스크립트 액세스가 허용되지 않음 ');

class EmailTest extends CI_Controller{ 

    function __construct(){ 
     parent::__construct(); 
     $this->load->helper(array('form', 'url')); 
     $this->load->library('form_validation'); 
     $this->load->library('tank_auth'); 
     $this->lang->load('tank_auth'); 
    } 

    function sendTest(){ 
     $this->load->library('email'); 
     $this->email->from($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth')); 
     //$this->email->reply_to($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth')); 


     $this->email->to('camer[email protected]'); 
     $this->email->subject("Here and There"); 
     $this->email->message("I hear you are an example"); 
     $this->email->send(); 

     echo $this->email->print_debugger(); 
    } 
} 
?> 

이메일 완전히 좋은 땅과이 출력을 생성한다 :

User-Agent: CodeIgniter 
Date: Mon, 14 Apr 2014 18:55:55 +1000 
From: "EPI Dashboard" <[email protected]> 
Return-Path: <[email protected]> 
Reply-To: "[email protected]" <[email protected]> 
X-Sender: [email protected] 
X-Mailer: CodeIgniter 
X-Priority: 3 (Normal) 
Message-ID: <[email protected]> 
Mime-Version: 1.0 
Content-Type: multipart/alternative; boundary="B_ALT_534ba29b8708b" 


=?utf-8?Q?Here_and_There?= 
This is a multi-part message in MIME format. 
Your email application may not support this format. 

--B_ALT_534ba29b8708b 
Content-Type: text/plain; charset=utf-8 
Content-Transfer-Encoding: 8bit 

I hear you are an example 


--B_ALT_534ba29b8708b 
Content-Type: text/html; charset=utf-8 
Content-Transfer-Encoding: quoted-printable 

I hear you are an example 

--B_ALT_534ba29b8708b-- 

서버는 분명히에 CentOS 6 개 VPS 실행 후위 및 PHP/MySQL을/아파치입니다.

확인할 사항이나 생각할 수있는 리소스에 대한 의견을 보내 주시면 대단히 감사하겠습니다. 즉시 문제를 해결

sendmail_path = /usr/sbin/sendmail -t -i 

:

답변

0

이 서버의 php.ini 파일 라인이 필요합니다. 전자 메일의 일부가 신체가 아닌 왜 나타나는지는 확실하지 않지만 작동합니다.

관련 문제