Skip to content

Instantly share code, notes, and snippets.

@mheidari98
Last active July 26, 2023 01:28
Show Gist options
  • Save mheidari98/88d4c4099c4075fcbc57069d113609b3 to your computer and use it in GitHub Desktop.
Save mheidari98/88d4c4099c4075fcbc57069d113609b3 to your computer and use it in GitHub Desktop.
Bulk SMS Sender
import time
import pandas as pd
from ipaddress import IPv4Address
from pyairmore.request import AirmoreSession
from pyairmore.services.messaging import MessagingService
textMessage = "سلام" # your msg
df = pd.read_excel("Students.xlsx") # excel file
phones = list(set(df.iloc[:, 4].to_list()))
androidIP = IPv4Address("192.xx.xx.xx") # fill this with phone ip addr
androidSession = AirmoreSession(androidIP)
smsService = MessagingService(androidSession)
for phone in phones:
mobileNumber = f"+98{phone}"
if len(mobileNumber) == 13 :
print(f"sms send to {mobileNumber[:6]}****{mobileNumber[-3:]}")
smsService.send_message(mobileNumber, textMessage)
time.sleep(1)
else:
print(f"Check this number: {phone}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment