Это код из плагина для cms, но думаю разберетесь:
/**
     * @param string $to
     * @param string $text
     * @param string $from
     * @return mixed
     */
    public function send($to, $text, $from = null)
    {
        $ch = curl_init("http://sms.ru/sms/send");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        $post = array(
            "api_id" => $this->getOption('api_id'),
            "to"     => $to,
            "text"   => $text
        );
        // check from
        if ($from && preg_match("/^[a-z0-9_-]+$/i", $from) && !preg_match('/^[0-9]+$/', $from)) {
            $post['from'] = $from;
        }
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
        $result = curl_exec($ch);
        curl_close($ch);
        $result = explode("\n", $result);
        if ($result[0] == 100) {
            unset($result[0]);
            return $result;
        } else {
            return false;
        }
    }