import network
import time
from twilio.rest import Client
# Your Account SID and Auth Token from twilio.com/console
account_sid = 'AC7453b8c526f2e794354d093abc8fed52'
auth_token = '229ed4405177834bbdefeea0f1ff7344'
client = Client(account_sid, auth_token)
print("Connecting to WiFi", end="")
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect("Wokwi-GUEST", "")
while not wlan.isconnected():
print(".", end="")
time.sleep(0.1)
print(" Connected!")
print(wlan.ifconfig())
# Create and send a message
message = client.messages.create(
body="Hello, this is a test message from Twilio!",
from_='+15176189861', # Your Twilio phone number
to='+918668135837' # The recipient's phone number
)
# Print the SID of the message
print(message.sid)