Python SMS Sender
Published in
Oct 13, 2023
This blog post offers a comprehensive guide to enhancing your communication capabilities using two powerful tools: Twilio and Ntfy. With Twilio, you can easily send SMS messages, while Ntfy enables you to receive notifications on your mobile device.
Twilio
- Register an account at https://www.twilio.com/en-us
- Verify your phone number
- Send an SMS to your number
from twilio.rest import Client
account_sid = 'account_sid'
auth_token = 'auth_token'
client = Client(account_sid, auth_token)
message = client.messages.create(
from_='your twillo number',
body='Hello Louis, Be patient. Sometimes you have to go through the worst to ge the best.',
to='your phone number'
)
print(message.sid)
ntfy
- Download nyfy app on your phone
- Subscribe to a topic you created via app
- Send a message to that topic channel
import requests
requests.post("https://ntfy.sh/your_topic_channel",
data="Hello Louis 😀".encode(encoding='utf-8'))