Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $accountsid = 'XXXXXXXXXXXXXXX';// Your AccountSid
- $authtoken = 'XXXXXXXXXX';// Your authtoken
- $to = 'XXXXXXXXXX'; // Your business call phone you wish to have sms forwarded too
- $from = 'XXXXXXXXXX'; // Your Message360 number
- $content = "Hi ".$_POST[host].", this is just a reminder that we have a meeting scheduled for ".$_POST[time]." at ".$_POST[location]."";//content of the SMS
- $tocountrycode = 1;
- $fromcountrycode = 1;
- $url = "https://api.message360.com/api/v2/sms/sendsms.xml";
- $username = $accountsid;
- $password = $authtoken;
- $post = array(
- 'body' => $content,
- 'to' => $to,
- 'from' => $from,
- 'tocountrycode' => $tocountrycode,
- 'fromcountrycode' => $fromcountrycode);
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
- curl_setopt($ch, CURLOPT_USERPWD, $username.":".$password);
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
- curl_setopt($ch,CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_POST, count($post));
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- $post_response = curl_exec($ch);
- // Checks for Errors
- if (curl_errno($ch) > 0)
- {
- $error = curl_getinfo($request);
- echo "ERROR: <BR>";
- print_r($error);
- $_SESSION['curl_error'] = curl_getinfo($ch);
- $_SESSION['gnc_order_error'] = TRUE;
- }
- curl_close($ch);
- exit;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement