#!/usr/bin/python2
print 'Content-Type: text/html'
print # Blank line marking end of HTTP headers
import socket
HOST = 'xml3.aspsms.com' # The remote host
PORT = 5061 # The same port as used by the server
userkey = #please fill in your USERKEY
password = #please enter your PASSWORD
originator = #please fill in the ORIGINATOR
recipient = #please insert the RECIPIENT here
text = #Your SMS Text
CONTENT="""<?xml version="1.0" encoding="ISO-8859-1"?>
<aspsms>
<Userkey>"""+str(userkey)+"""</Userkey>
<Password>"""+str(password)+"""</Password>
<Originator>"""+ str(originator) +"""</Originator>
<Recipient>
<PhoneNumber>"""+ str(recipient) +"""</PhoneNumber>
</Recipient>
<MessageData>"""+ str(text) +"""</MessageData>
<Action>SendTextSMS</Action>
</aspsms>"""
length=len(CONTENT)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send("POST /xmlsvr.asp HTTP/1.0
")
s.send("Content-Type: text/xml
")
s.send("Content-Length: "+str(length)+"
")
s.send(CONTENT)
datarecv=s.recv(1024)
print "Reply Received: "+ str(datarecv)
s.close()