Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function SendREST($username, $password, $Source, $Destination, $MsgBody, $Encoding)
- {
- $URL = "http://URL/sendsms";
- $msg = urlencode(trim($MsgBody));
- $url = $URL . '?username=' . $username . '&password=' . $password . '&source=' . $Source . '&destination=' . $Destination . '&message=' . $msg;
- $headers[] = 'Accept: text/html';
- $headers[] = 'Connection: Keep-Alive';
- $headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
- $process = curl_init($url);
- curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($process, CURLOPT_HEADER, 0);
- curl_setopt($process, CURLOPT_TIMEOUT, 30);
- curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
- return curl_exec($process);
- try {
- $return = curl_exec($process);
- if ($return) {
- return true;
- }
- } catch (Exception $ex) {
- return false;
- }
- }
- var soap = require('soap');
- var url = 'http://URL/sendsms';
- var args = {username: '5280',password:'3310AZa',source:'08888735280',destination:'97823036569',message:'SHOOOOOOT !!'};
- app.get('/sendsms', function (req, res) {
- soap.createClient(url, function (err, client) {
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement