Example of python using PyFetion to send short messages
- 2020-04-02 13:36:50
- OfStack
Through PyFetion, it is convenient to use python to send short messages with fetion. The code is posted below:
from fetion import *
import os
def SendSMS(sms):
myphone = 'xxxxxx'
mypwd = 'oooooooooo'
tophone = 'oxoxoxoxoxox'
fetion = PyFetion(myphone,mypwd,'TCP')
fetion.login(FetionHidden)
print 'send to '+tophone
fetion.send_sms(sms,tophone,True)
print 'OK'
fetion.logout()
return True
msg = "hello world"
SendSMS(msg)
print 'OK!!!'
Sometimes you are prompted to enter a captcha in one of the images generated by PyFetion. Look at the image and enter the captcha.
PyFetion project home page: https://code.google.com/p/pytool/