-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.py
47 lines (32 loc) · 976 Bytes
/
functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from index import Sendsms
import requests
import json
import urllib.request
def bulksms(telephone,smsname,message,username,password):
print(username)
data={
'username':username,
'password':password,
'type':0,
'dlr':1,
'destination':telephone,
'source':smsname,
'message':message
}
sms = requests.post(' http://rslr.connectbind.com:8080/bulksms/bulksms',data=data).text
res=sms[:4]
print(res)
if res ==str(1701):
print(sms)
print('your message has been sent')
elif res==str(1703):
print("Invalid credentials")
elif res==str(1702 ):
print("Invalid URL")
elif res==str(1706):
print("Invalid destination check your phone")
elif res==str(1707):
print("Invalid Sender - SMS name ca not go beyond 11 character")
else:
print("error occured with code :"+res+"")
return