Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Welcome extends CI_Controller {
- public function index()
- {
- $config = Array(
- 'protocol' => 'smtp',
- 'smtp_host' => 'ssl://smtp.googlemail.com',
- 'smtp_port' => 465,
- 'smtp_user' => 'emai@gmail.com', //harus di set terlebih dahulu di gmail
- 'smtp_pass' => 'paswordgoogl',
- 'mailtype' => 'html',
- 'charset' => 'iso-8859-1'
- );
- $this->load->library('email', $config);
- $this->email->set_newline("\r\n");
- $this->email->from('email@gamil.com', 'Admin josan');
- $this->email->to('contoh@gmail.com');
- $this->email->subject('Percobaan email');
- $this->email->message('Ini adalah email percobaan ');
- if (!$this->email->send()) {
- show_error($this->email->print_debugger());
- }else{
- echo 'Success to send email';
- }
- $this->load->view('welcome_message');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement