In  CodeIgniter  It is very easy to integrate SMS facility to your application. Since SMS gateway follows different methods, here are some steps to get an idea that how you can do it.


1.     Create Controller

2.     Now you can create a function let’s say sendSms() . In that function you can apply the following code.  Here to test you can sent the static values to check whether functions are working or not.  The commented part is the dynamic values.

3.     Write the below code to send message.

$this->load->model (‘modelname’, “sms”);

$message=’ I am xyz’;


// If Mobile No and Message are  Dynamic  so write   below the line.


// $mobile = $this->input->post(‘mobileno’);



1.     Create Model.

<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);

class modelname extends CI_Model {

public function smssend($mobile,$message)


$request=’username=username &pass=123456&senderid=Usersenderid              &dest_mobileno=’.$mobile.’&message=’.$message.’&response=Y’;

$ch = curl_init(‘’);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $request);



return $resuponce;