Welcome Guest, Not a member yet? Register   Sign In
Error with email class in CI 3.1.8
#1
Bug 
(This post was last modified: 04-04-2018, 01:11 AM by ardavan.)

Hey everybody.

I'm trying to use email class as usual.

I have loaded the email library in the autoload.php and made an email.php file in my config folder and in my controller trying to send() the email.

But I get Error "NOT" on the browser, rather in the log file. I don't have this problem with CI 3.1.5 by the way!
Does anyone have any idea?

config > email.php
PHP Code:
defined('BASEPATH') OR exit('No direct script access allowed');
$config['protocol']    = 'smtp';
$config['smtp_host']    = 'mail.mydomain.com';
$config['smtp_port']    = '26';
$config['smtp_timeout'] = '7';
$config['smtp_user']    = 'myusername';
$config['smtp_pass']    = 'mypassword';
$config['charset']    = 'utf-8';
$config['newline']    = "\r\n";
$config['mailtype'] = 'html';
$config['validation'] = TRUE

controller
PHP Code:
$message $this->load->view('edm/verification'''TRUE);
$this->email->from($this->config->item('from'), $this->config->item('appName'));
$this->email->to($email);
$this->email->subject('Welcome to '.$this->config->item('appName'));
$this->email->message($message);

if( ! 
$this->email->send()):
 
$this->session->set_flasdata('error'$this->lang->line('unableSendingEmail'));
endif; 

log file
Code:
ERROR - 2018-04-04 01:49:43 --> Severity: Error --> Call to a member function from() on string /home1/xxx/public_html/myProject/application/controllers/User.php 129
Reply


Messages In This Thread
Error with email class in CI 3.1.8 - by ardavan - 04-04-2018, 12:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB