An example application that demonstrates how to send SMS text messages using C and libCurl. Requires a POSIX compliant system.
Please read our full article for more information. Our C++ example might be useful as well:
git clone https://github.com/pkamp3/twilio_c_sms.git cd twilio_c_sms make
(You must have a Twilio account to run this example.)
Account SID and the Auth Token can be found in your Twilio console. Change the from number to a number in your Twilio Account, and change the to number to someone you'd like to get a message!
account_sid=ACXXXXXXXXXXXXXXXXXXXXXX auth_token=your_auth_token bin/c_sms -a $account_sid -s $auth_token -t "+18005551212" -f "+18005551213" -m "Hello, World!" # Optionally, add '-p' to send a MMS, example: '-p https://demo.twilio.com/logo.png'
Hopefully you can use this as a base for a larger project. The twilio_send_message function should be relatively portable as long as you link libcurl.
- MIT License
- Lovingly crafted by Twilio Developer Education.