There are various scenarios when you may have an IoT device in the field where you do not need a 4G LTE or 5G connectivity or where you have poor connectivity such as in forests or mountains. These scenarios include situations where your IoT device may only need to send data in occasional spurts, and may never need to receive any commands, or receive a very small set of pre-designed commands to control the device.
For such scenarios, where you do not want your IoT device to be connected to the internet all the time using a 4G or 5G network, use up too much battery power and be relatively secure from remote attacks over the internet, a simple GSM modem can solve your problem. For example, we have built a device in the past where a USB modem connected to a transport vehicle would send an SMS with the latitude and longitude of its location every 5 minutes. There were other scenarios where an IoT device we prototyped would be placed in a forest and would send the temperature and humidity levels over SMS every hour.
A perpetually connected device that uses a data plan can become prohibitively expensive if you want to just send short messages. This post describes how to write simple programs to use an off the shelf modem, that can be purchased for less than $10, and using a SIM card that provides Unlimited text messaging to send and receive SMS messages.
You may also want to build your own SMS over the internet service like that of Twilio from scratch and this script can help you start.