0% found this document useful (0 votes)
109 views1 page

Python Send SMS

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 1

To send sms using way2sms account, you may use below code snippet.

Before that you would be required to create an API Key from here


import requests
url = "https://smsapi.engineeringtgr.com/send/"
params = dict(
Mobile='login username',
Password='login password',
Key='generated from above sms api',
Message='Your message Here',
To='recipient')

resp = requests.get(url, params)


print(resp, resp.text)
N.B: There is a limit of approx 20 sms per day

import requests

url = "https://www.fast2sms.com/dev/bulk"

payload = "sender_id=FSTSMS&message=Good morning , this is prasad sending from


python.&language=english&route=p&numbers=9052766763,7013514480"

headers = {

'authorization': "your app key",

'Content-Type': "application/x-www-form-urlencoded",

'Cache-Control': "no-cache",

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

You might also like