Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * SENDS EMAIL WITH GMAIL
- */
- class Email extends CI_Controller {
- function __construct()
- {
- parent::__construct();
- }
- function index()
- {
- $config = Array(
- 'protocol' => 'smtp',
- 'smtp_host' => "ssl://smtp.googlemail.com",
- 'smtp_port' => 465,
- 'smtp_user' => 'xxx',
- 'smtp_pass' => 'zzz'
- );
- $this->load->library('email', $config);
- $this->email->set_newline("\r\n");
- $this->email->from('xxx@gmail.com', 'Jack');
- $this->email->to('yyy@gmail.com');
- $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());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement