Building an app that can send sms/mms

I want to build an app like imessage that can send sms/mms over the cellular-data networks if Wi-Fi is unavailable. Any suggestion on how?

Just a suggestion: Since it requires hardware-level access (sms) i would go for meteor integrated with cordova, then detect meteor status online/offline, if the first one - send data through http, if offline send through sms.