Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. <?php
  2. $accountsid = 'XXXXXXXXXXXXXXX';// Your AccountSid
  3. $authtoken = 'XXXXXXXXXX';// Your authtoken
  4. $to = 'XXXXXXXXXX'; // Your business call phone you wish to have sms forwarded too
  5. $from = 'XXXXXXXXXX'; // Your Message360 number
  6. $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
  7. $tocountrycode = 1;
  8. $fromcountrycode = 1;
  9.  
  10.  
  11.  
  12. $url = "https://api.message360.com/api/v2/sms/sendsms.xml";
  13. $username = $accountsid;
  14. $password = $authtoken;
  15.  
  16. $post = array(
  17. 'body' => $content,
  18. 'to' => $to,
  19. 'from' => $from,
  20. 'tocountrycode' => $tocountrycode,
  21. 'fromcountrycode' => $fromcountrycode);
  22. $ch = curl_init();
  23.  
  24. curl_setopt($ch,CURLOPT_URL,$url);
  25. curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  26. curl_setopt($ch, CURLOPT_USERPWD, $username.":".$password);
  27. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  28. curl_setopt($ch,CURLOPT_HEADER, false);
  29. curl_setopt($ch, CURLOPT_POST, count($post));
  30. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  31. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  32. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  33.  
  34. $post_response = curl_exec($ch);
  35.  
  36. // Checks for Errors
  37. if (curl_errno($ch) > 0)
  38. {
  39. $error = curl_getinfo($request);
  40. echo "ERROR: <BR>";
  41. print_r($error);
  42. $_SESSION['curl_error'] = curl_getinfo($ch);
  43. $_SESSION['gnc_order_error'] = TRUE;
  44. }
  45. curl_close($ch);
  46. exit;
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement