First of all you have to make an account on Fast2sms.com and have to get an api key ..
Source Code...
#required module-pip install requests
import requests
#taking phon no to send
N=input("please enter phon no")
#message that you want to send
M=input("please enter your messege")
#url for web message hosting server
url = "https://www.fast2sms.com/dev/bulk"
#passing a value to dictonory
querystring = {"authorization":"Your Api key",
"sender_id":"FSTSMS",
"message":M,
"language":"english",
"route":"p",
"numbers":N}
headers = {
'cache-control': "no-cache"
}
#Sending a requests and storing in variable
response = requests.request("GET", url, headers=headers, params=querystring)
#printing a response variable
print(response.text)
#printing sucessfully sent message
print("messege send succesffuly")

0 Comments