Send and Read SMS

Another easy thing you can do is send and receive SMS messages. Lets start by sending an SMS. We'll use twitter's 40404 short code, which will auto respond, making it easy to verify both sending and receiving

You can send multi-line SMS's using the library API but for this example, its easier to parse the data if its a single line!

You can then ask the SIM how many SMS's it has with N and read all of them with R

Note that SMS's are referred to by slots but the number does not include empty slots. We'll show this in detail in a bit

You can read individual SMS's with r

And delete SMS's by slot # with d

Note that before I deleted SMS #2, so if I read them again, that SMS # will be an empty slot. SMS number #3 doesn't "move slots"!

This guide was first published on Jul 17, 2015. It was last updated on Mar 08, 2024.

This page (SMS) was last updated on Feb 10, 2016.

Text editor powered by tinymce.