· 8 years ago · Dec 09, 2017, 11:04 PM
1$config['protocol'] = 'smtp';
2 $config['smtp_host'] = 'ssl://smtp.googlemail.com';
3 $config['smtp_port'] = 465;
4 $config['smtp_user'] = '*******@gmail.com'; // change it to yours
5 $config['smtp_pass'] = '******'; // change it to yours
6 $config['charset' ] = 'iso-8859-1';
7 $config['newline' ] = "rn";
8
9 $config['mailtype' ] = 'text';
10
11 $config['validation' ] = TRUE;
12 $this->load->library('email',$config);
13
14
15
16 $this->email->from('*********@gmail.com');
17 $this->email->to('********@gmail.com');
18 $this->email->subject('Confirmation Email');
19 $this->email->message('Thank you');
20
21 if ($this->email->send())
22 {
23 echo "send successfully";
24
25
26 }
27 else
28 {
29 show_error($this->email->print_debugger());
30 }