Dear Silvano, your doubt is not specified, what do you want to do? Want tips on where to start, how to do it? How far do you know? This way we can help you better.
There are some ways to do this:
1) Calling a web service/API (easiest way)
- Search by sms gateway or sms api (There are companies specialized in this type of service in Brazil, unfortunately only know the companies in Spain that is where I live, if you need help to search comments below that I help you.) I made a quick query on google by "text messaging service" and I saw several options in php, javascript and other languages and adapting to java would not be a problem because it is usually http calls.
2) Creating a server connected to a mobile phone, as you said that staying in the cloud would be unviable.
Like this:
Case your sms need to have legal validity, which nowadays is super high, Oce could try to hire Certising where uses the services of the company where I work Lleida.net to send sms and emails certified.