04-05-2011, 11:42 AM
[eluser]Unknown[/eluser]
VALID FOR CodeIgniter 2:
Previous: $this->load->library('email', $config_array), and so on hangs & does not work on codeigniter 2
cheers!
VALID FOR CodeIgniter 2:
Code:
$this->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://smtp.googlemail.com";
$config['smtp_port'] = "465";
$config['smtp_user'] = "[email protected]";//also valid for Google Apps Accounts
$config['smtp_pass'] = "your_gmail_pass";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";
$this->email->initialize($config);
$this->email->from('[email protected]', 'YOUR_NAME');
$list = array('[email protected]', [email protected]',[email protected]','[email protected]');
$this->email->to($list);
$this->email->subject('TESTING GMAIL');
$this->email->message('<h1>TEXT MSG<h1>'); //Your cool html5 ;P
$this->email->set_alt_message(strip_tags('<h1>TEXT MSG<h1>')); //Only text
if ( ! $this->email->send())
{
show_error($this->email->print_debugger());
} else {
echo('DONE');
}
Previous: $this->load->library('email', $config_array), and so on hangs & does not work on codeigniter 2
cheers!