[eluser]MikeW1911[/eluser]
Hello, please keep in mind I am a beginner to Codeigniter and that I am using version 2.1.0, thank you.
I am trying to send an email using this controller code:
Code:
class Email extends CI_Controller {
public function index(){
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'my gmail email address',
'smtp_pass' => 'my gmail password',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline('\r\n');
$this->email->from('my gmail email address', 'some guy');
$this->email->to('my hotmail email address');
$this->email->subject('this is an email test');
$this->email->message('it is working. Great!');
if ($this->email->send()){
echo 'Your email was sent, fool.';
}
else{
show_error($this->email->print_debugger());
}
}
}
When I load the controller, the page does not finishing loading for some reason; I see neither "Your email was sent, fool." nor a debug report on the page. Tell me I didn't make a dumb mistake.