php - CodeIgniter/TankAuth forgot_password function sending emails with no content -
recently moved existing codeigniter product own vps, working away. however, reason password has been invalidated , when forgot_password function run email arrives intact subject line, however, emails have no content. @ all. offending code:
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(); }
i wrote short php script send email using same codeigniter library:
<?php
if(!defined('basepath')) exit('no direct script access allowed');
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('cameron.j.leafe@gmail.com'); $this->email->subject("here , there"); $this->email->message("i hear example"); $this->email->send(); echo $this->email->print_debugger(); } } ?>
that email lands fine, , produces output:
user-agent: codeigniter date: mon, 14 apr 2014 18:55:55 +1000 from: "epi dashboard" <epi@epidashboard.com> return-path: <epi@epidashboard.com> reply-to: "epi@epidashboard.com" <epi@epidashboard.com> x-sender: epi@epidashboard.com x-mailer: codeigniter x-priority: 3 (normal) message-id: <534ba29b87010@epidashboard.com> mime-version: 1.0 content-type: multipart/alternative; boundary="b_alt_534ba29b8708b" =?utf-8?q?here_and_there?= multi-part message in mime format. email application may not support format. --b_alt_534ba29b8708b content-type: text/plain; charset=utf-8 content-transfer-encoding: 8bit hear example --b_alt_534ba29b8708b content-type: text/html; charset=utf-8 content-transfer-encoding: quoted-printable hear example --b_alt_534ba29b8708b--
the server centos 6 vps running postfix , php/mysql/apache.
any thoughts on check or resources can think of appreciated.
the php.ini file server need have line:
sendmail_path = /usr/sbin/sendmail -t -i
which fixed problem instantly. not entirely sure why parts of email showing , not body, works.
Comments
Post a Comment