Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Email extends CI_Controller
- {
- function __construct()
- {
- parent:: CI_Controller();
- }
- function index() {
- $config = Array(
- 'protocol' =>'smtp',
- 'smtp_host' => 'ssl://smtp.googlemail.com',
- 'smtp_port' => 465,
- 'smtp_user' => 'nikoletta.fytampani@gmail.com',
- 'smtp_pass' => 'lettabozika86'
- );
- // dik mou $config= $this->load->config->email($config);
- $this->load->library('email',$config);
- $this->email->set_newline("\r\n");
- $this->email->from('nikoletta.fytampani@gmail.com','Zetta');
- $this->email->to('nikoletta.fytampani@gmail.com');
- $this->email->subject('THis is an email test');
- $this->email->message('its is working!!');
- $path = $this->config->item('server_root');
- //echo $path; die();
- $file = $path.'/CI3/attachments/yourinfo.txt';
- $this->email->attach($file);
- if($this->email->send())
- {
- echo "Mail was sent";
- }
- else
- {
- show_error($this->email->print_debugger());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement