Skip to main content

C++

/* SPIRIcom HTTP GET C++ example This example requires CURL. For instructions on installation please visit http://curl.haxx.se/libcurl */ #include <curl/curl.h> #include <iostream> #include <string> using namespace std;
int main() {
/* Change this to your username */ string user = "myuser";
/* Change this to your password */ string pass = "mypass";
/* This is the short message to be sent */ string msg = "test";
/* Sender of the short message */ string from = "+46712345678";
/* Recipient of the short message */ string to = "+467123456789";
/* Construct the URL */ string url = "http://get.spiricom.spirius.com:55000/cgi-bin/sendsms?User" + user + "&Pass=" + pass + "&From=" + from + "&To=" + to + "&Msg=" + msg;
/* Create and send the GET-request */ CURL *ch = curl_easy_init();
curl_easy_setopt(ch, CURLOPT_URL, url.c_str());
curl_easy_perform(ch);
curl_easy_cleanup(ch);
}