You can have your raspberry pi send you an SMS that routes through your gmail account.
How it works:
You send an email to a specific address like:
[phonenumber]@carrier_gateway.com
For a Verizon number 1234567890, send an email to:
1234567890@vtext.com
Python Example: SMS_via_gmail.py
Important Notes:
You need to enable SMTP access on your email account (Gmail might require an App Password). See below
You need to know the recipient’s carrier (to use the correct SMS gateway in LINE 7 of the code). Here's a brief overview of some common carriers and their SMS gateways:
AT&T: [number]@txt.att.net
T-Mobile: [number]@tmomail.net
Verizon: [number]@vtext.com
Sprint: [number]@messaging.sprintpcs.com
You need an App Password, not your Gmail password.
Step 1: Turn on 2-Step Verification (if not already)
Under "Signing in to Google", enable 2-Step Verification
Step 2: Generate an App Password
Select "Mail" as the app
Select "Other" as the device, and name it (e.g., "Raspberry Pi SMS")
Click Generate
Copy the 16-character password Google gives you
Step 3: Replace in Your Line 12 Code
Instead of: server.login("your_email@gmail.com", "your_gmail_password")
Use: server.login("your_email@gmail.com", "your_16_character_app_password")
That should let the email go through and send the SMS using the carrier gateway.
Rate Limiting / Throttling
Most carriers have rate limits to prevent abuse (e.g., spam or bulk messaging).
Typical limit: around 30–50 messages per day or 1 message per minute per sender.
Sending too many messages too quickly may cause silent failures or blacklisting.
Character Limits
SMS has a 160-character limit (including subject + message).
Anything longer may get truncated or split into multiple messages (if supported).
Some gateways strip out the subject entirely and only send the body.
Carrier Filtering
Some carriers filter or block messages that appear spammy or come from unfamiliar SMTP servers.
Make sure your "From" email is valid and not marked as spam.
No Delivery Confirmation
You usually don’t get a delivery status back, unlike with APIs like Twilio.
If the message fails, you might not know.