#Send SMS using PYTHON

import urllib # Python URL functions
import urllib2 # Python URL functions
apikey = "YourApikey" # Your APIKEY key.
senderid = "senderid" # Approved sender id(6 characters string only).
channel = "channel" # Message channel Promotional=1 or Transactional=2.
DCS = "0" # Default is 0 for normal message, Set 8 for unicode sms.
flashsms = "0" # Default is 0 for normal sms, Set 1 for immediate display.
number = "9999999999" # Recipient mobile number (pass with comma seprated if need to send on more then one number).
message = "Test message" # Your message to send.
route = "default" # Define route
# Prepare you post parameters
values = {
'apikey' : apikey,
'senderid' : senderid,
'channel' : channel,
'DCS' : DCS,
'flashsms' : flashsms
'number' : number
'message' : message
'route' : route
}

url = "https://www.smsgatewayhub.com/api/mt/SendSMS?" # API URL
postdata = urllib.urlencode(values) # URL encoding the data here.
req = urllib2.Request(url, postdata)
response = urllib2.urlopen(req)
output = response.read() # Get Response
print output # Print Response