title: Send message from whatsapp in php
body: <p>I want to send document/message from whatsapp using php.
  i have both username and password. But when i am trying to send message then it shows me a socket write warning. </p>
  
  <p>My Code to send message : Its not working</p>
  
  <pre><code>set_time_limit(-1);
  require_once('src/whatsprot.class.php');
  $username = "91xxxxxxxx"; //Mobile Phone prefixed with country code so for india it will be 91xxxxxxxx
  $password = "skljelsiej";
  $w = new WhatsProt($username, 0, "Mayank Grover Blog", true); //Name your application by replacing “WhatsApp Messaging”
  $w-&gt;connect();
  $w-&gt;loginWithPassword($password);
  $target = '91xxxxxxxxxx'; //Target Phone,reciever phone
  $message = 'Hello User !! This is a Tutorial for sending messages via php to WhatsApp Account';
  $w-&gt;SendPresenceSubscription($target); //Let us first send presence to user
  $w-&gt;sendMessage($target,$message ); // Send Message
  echo "Message Sent Successfully";
  </code></pre>