Welcome Guest, Not a member yet? Register   Sign In
Email class issues - smtp authentication error
#1

[eluser]Unknown[/eluser]
Ok I have the following code and the file permission on the controller are set to 755, unfortunately whenever I try to run the code I get an error saying smtp authentication failed. I have quadruple confirmed the smtp login information (for security reasons I didnt include it in the code). Anyway if anyone can tell me what Im doing wrong I would appreciate it.

Code:
<?php
class Ticketcontroller extends CI_Controller {

public function index()
{
// declares variables for
$smtp_host = "mail.1234.com";
$smtp_email = "[email protected]";
$smtp_pass = "1234"

// sets email class settings
$config['protocol'] = 'smtp';
$config['smtp_host'] = $smtp_host;
$config['smtp_user'] = $smtp_email;
$config['smtp_pass'] = $smtp_pass;

// loads email class
$this->load->library('email');

// initializes email class configuration
$this->email->initialize($config);

//formats and sends the actual email
$this->email->from($smtp_email);
$this->email->to($smtp_email);
$this->email->subject('test');
$this->email->message('test');

$this->email->send();

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




Theme © iAndrew 2016 - Forum software by © MyBB