Codeigniter Email

Step 1
php.ini>uncomment opsenssl

Step 2
In email controller,
function email(){
$config[‘protocol’] = ‘smtp’;
$config[‘smtp_host’] = ‘ssl://smtp.googlemail.com’;
$config[‘smtp_port’] = 465;
$config[‘smtp_user’] = ‘miss.sumyatnoepwint@gmail.com’;
$config[‘smtp_pass’] = ‘chochowintintun’;
$this->load->library(’email’, $config);
$this->email->set_newline(“\r\n”);
$this->email->from(‘miss.sumyatnoepwint@gmail.com’, ‘Su Myat’);
$this->email->to(‘sumyat@a.com’);
$this->email->subject(‘This is an email test’);
$this->email->message(‘It is working. Great!’);
if($this->email->send())
{
echo ‘Your email was sent, successfully.’;
}

else
{
show_error($this->email->print_debugger());
}
}

Asynchronous vs. Synchronous Web Services

Synchronous communication is direct communication where the communicators are time synchronized. This means that all parties involved in the communication are present at the same time. This includes, but is not limited to, a telephone conversation (not texting), a company board meeting, a chat room event and instant messaging.

Asynchronous communication does not require that all parties involved in the communication to be present at the same time. Some examples are e-mail messages, discussion boards, blogging, and text messaging over cell phones. In distance (specifically online) education asynchronous communication is the major (sometimes the only) method of communication. Usually, we use different discussion boards in each class with each having its own purpose.

e.g. synchronous

When I call you on the phone, I dial your number and WAIT until you pick up. Then you say something, and in the very same moment I listen to you. When you finished, I send you data (talk to you) and in the same moment you receive them (listen to me). At the end of our communication one of us says “END OF TRANSMISSION” (Good Bye), the other says “Acknoledged” (Good Bye) and then both ring off.

asynchronous

I write you a letter. I put it to the postoffice, and it will be sent to you. I the meantime I do NOT WAIT. I do many different other things. Then you receive the letter. You read it while I still do many different other things. Then you write me an answer and send it to me. In all those things I am not involved. At the next day I get a (synchronous) message (a signal) from the system (postman). It (he) says: “Here is a message for you”. Alternatively I could poll my inbox every five minutes to check if a new letter is there. Then I pause my other work, receive your letter and read your answer. Then I do something according to this answer. But this are things you will not notice, because you are not involved in what I do with your asynchronous answer.

http://stackoverflow.com/questions/17872854/synchronous-vs-asynchronous-related-to-web-services

REST

REST is 

Representational state transfer.  REST-style architectures conventionally consist of clients and servers.

RESTful web API HTTP methods

Resource 1: http://example.com/resources

PUT:Replace the entire collection with another collection.

POST: Create a new entry in the collection. The new entry’s URI is assigned automatically and is usually returned by the operation.

Resource 2:http://example.com/resources/item17

PUT:Replace the addressed member of the collection, or if it doesn’t exist, createit.

POST:Not generally used. Treat the addressed member as a collection in its own right and create a new entry in it.