based on https://linuxhint.com/automatically_send_text_message_android_python
Last active
July 26, 2023 01:28
-
-
Save mheidari98/88d4c4099c4075fcbc57069d113609b3 to your computer and use it in GitHub Desktop.
Bulk SMS Sender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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