Title: PHP function wp_sms_send does not work
Last modified: November 3, 2019

---

# PHP function wp_sms_send does not work

 *  [maijx](https://wordpress.org/support/users/maijx/)
 * (@maijx)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/php-function-wp_sms_send-does-not-work/)
 * Hi,
    After latest update the PHP function wp_sms_send does not work anymore. 
   Please check this issue.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * (@mostafas1990)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/php-function-wp_sms_send-does-not-work/#post-12092398)
 * Please try to get the result of the function
 *     ```
       $result = wp_sms_send(...
       print_r($result);
       ```
   
 *  Thread Starter [maijx](https://wordpress.org/support/users/maijx/)
 * (@maijx)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/php-function-wp_sms_send-does-not-work/#post-12095511)
 * This is the result:
 * `WP_Error Object ( [errors] => Array ( [send-sms] => Array ( [0] => Array ( [
   headers] => Requests_Utility_CaseInsensitiveDictionary Object ( [data:protected]
   => Array ( [cache-control] => no-store, no-cache, must-revalidate,no-cache [pragma]
   => no-cache [content-type] => application/json;charset=utf-8 [server] => Array([
   0] => Microsoft-IIS/8.5 [1] => Kavenegar ) [access-control-allow-origin] => *[
   access-control-allow-headers] => Content-Type [access-control-allow-method] =
   > POST, GET, OPTIONS [date] => Mon, 04 Nov 2019 16:30:49 GMT ) ) [body] => {"
   return":{"status":411,"message":"دریافت کننده نامعتبر است"},"entries":null} [
   response] => Array ( [code] => 411 [message] => Length Required ) [cookies] =
   > Array ( ) [filename] => [http_response] => WP_HTTP_Requests_Response Object([
   response:protected] => Requests_Response Object ( [body] => {"return":{"status":
   411,"message":"دریافت کننده نامعتبر است"},"entries":null} [raw] => HTTP/1.1 411
   Length Required Cache-Control: no-store, no-cache, must-revalidate,no-cache Pragma:
   no-cache Transfer-Encoding: chunked Content-Type: application/json;charset=utf-
   8 Server: Microsoft-IIS/8.5 Access-Control-Allow-Origin: * Access-Control-Allow-
   Headers: Content-Type Access-Control-Allow-Method: POST, GET, OPTIONS Server:
   Kavenegar Date: Mon, 04 Nov 2019 16:30:49 GMT Connection: close {"return":{"status":
   411,"message":"دریافت کننده نامعتبر است"},"entries":null} [headers] => Requests_Response_Headers
   Object ( [data:protected] => Array ( [cache-control] => Array ( [0] => no-store,
   no-cache, must-revalidate,no-cache ) [pragma] => Array ( [0] => no-cache ) [content-
   type] => Array ( [0] => application/json;charset=utf-8 ) [server] => Array ( [
   0] => Microsoft-IIS/8.5 [1] => Kavenegar ) [access-control-allow-origin] => Array([
   0] => * ) [access-control-allow-headers] => Array ( [0] => Content-Type ) [access-
   control-allow-method] => Array ( [0] => POST, GET, OPTIONS ) [date] => Array ([
   0] => Mon, 04 Nov 2019 16:30:49 GMT ) ) ) [status_code] => 411 [protocol_version]
   => 1.1 [success] => [redirects] => 0 [url] => http://api.kavenegar.com/v1/xxx/
   sms/send.json/ [history] => Array ( ) [cookies] => Requests_Cookie_Jar Object([
   cookies:protected] => Array ( ) ) ) [filename:protected] => [data] => [headers]
   => [status] => ) ) ) ) [error_data] => Array ( ) )`
 *  Plugin Author [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * (@mostafas1990)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/php-function-wp_sms_send-does-not-work/#post-12097476)
 * Pay more attention to the error, It’s clear.
 *  Thread Starter [maijx](https://wordpress.org/support/users/maijx/)
 * (@maijx)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/php-function-wp_sms_send-does-not-work/#post-12097638)
 * I’ve checked everything with both Kavenegar and TSMS gateways, but none of them
   works with this function. It’s the same for both.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP function wp_sms_send does not work’ is closed to new replies.

 * ![](https://ps.w.org/wp-sms/assets/icon.svg?rev=3477319)
 * [WSMS (formerly WP SMS) – SMS & MMS Notifications with OTP and 2FA for WooCommerce](https://wordpress.org/plugins/wp-sms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-sms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-sms/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-sms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-sms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-sms/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [maijx](https://wordpress.org/support/users/maijx/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/php-function-wp_sms_send-does-not-work/#post-12097638)
 * Status: not resolved