Email sent in Codeigniter

Email sent in Codeigniter

	$config = Array(
			    'protocol' => 'smtp',
			    'smtp_host' => 'ssl://smtp.gmail.com',
			    'smtp_port' => 465,
			    'smtp_user' => 'username',
			    'smtp_pass' => 'password',
			    'mailtype'  => 'html', 
			    'charset'   => 'iso-8859-1'
				);

	$this->load->library('email', $config);
	$this->email->set_newline("\r\n");

	$this->email->from('sender_email', 'Identification');
        $this->email->to('receiver_email');
        $this->email->subject('Send Test Email Codeigniter');
        $this->email->message('The email send using codeigniter library');

	$result = $this->email->send();

	if ($result) 
	{
		echo "Mail send successfully";
	}else{

		echo "sending failed";
		print_r($result);
	}

1 Comments

avinash vyas

test by admin

Leave a Reply

You must be logged in to post a comment.