Welcome Guest, Not a member yet? Register   Sign In
sending email using code igniter
#7

Try this

PHP Code:
<?php

class Email extends CI_Controller
{
    function 
__construct()
    {
        
parent::__construct();
        
    }
    
    function 
index()
    {
        
$this->load->library('email');
    
        
$config = array(
            
'protocol' => 'smtp',
            
'smtp_host' => 'ssl://smtp.googlemail.com',
            
'smtp_port' => 465//465
            
'smtp_user' => '[email protected]',
            
'smtp_pass' => 'pass'
            'mailtype' 
=> 'text',
            
'charset' => 'iso-8859-1',
            
'wordwrap' => TRUE
        
);
        
        
$this->email->initialize($config);

        
$this->email->set_newline("\r\n");
        
$this->email->from('[email protected]','Ben Abrams');
        
$this->email->to('[email protected]');
        
$this->email->subject('This is an email test.');
        
$this->email->message('It is working.');
        
$this->email->send();
        
//echo $this->email->print_debugger();
        
        
if($this->email->send())
        {
            echo 
'Your email was sent';
        }
        else
        {
            
show_error($this->email->print_debugger());
        }
        
    }


Reply


Messages In This Thread
sending email using code igniter - by Ben - 01-15-2015, 08:35 PM
RE: sending email using code igniter - by Rufnex - 01-16-2015, 01:53 AM
RE: sending email using code igniter - by advoor - 01-16-2015, 03:30 AM
RE: sending email using code igniter - by Ben - 01-16-2015, 08:43 AM
RE: sending email using code igniter - by Rufnex - 01-16-2015, 09:23 AM
RE: sending email using code igniter - by Ben - 01-16-2015, 11:58 AM
RE: sending email using code igniter - by Rufnex - 01-16-2015, 03:08 PM
RE: sending email using code igniter - by Ben - 01-16-2015, 08:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB