6 Jan 2005
For a project I’m working on we need to send text messages to mobile phones. We could buy or rent an SMS gateway, but most carriers in the US allow you to email a message to yourphonenumber@yourcarrier and it will appear as a text message on the phone. For example, my phone is currently with AT&T so you can send a short email to 9166002497 AT mobile.att.net and it will show up on my phone.
The problem is figuring out what carrier the phone number is at so you can append the correct hostname to the email address. John Wehr pointed out Teleflip, a service that lets you send email to firstname.lastname@example.org and have it delivered to the phone, regardless of carrier. That’s dandy, but I don’t want to rely on some free, third party service that might change or go away later.
After spending some time looking for a way to determine the phone’s carrier, it hit me: I don’t really care what carrier they’re using. If I send the message to the incorrect carrier, it won’t get delivered to the wrong person because phone numbers are unique. It will just bounce. So if I wanted to send a message to 212-555-1212, I could just send a text message to email@example.com, firstname.lastname@example.org, email@example.com and so on. Send to them all and ignore the bounces. Based on the bounces, you could even learn which carrier someone’s using and just send to that one in the future.
It’s not terribly polite to send email that you know is going to bounce, but it’s not a huge load on the servers and you’d only do it once for each new number.
These are the last 15 comments. Read all 139 comments here.
©1999-2017 Adam Kalsey.
Content management by Movable Type.