微信掃一掃
認證、簽名模板審核結果通知
賬號短信余額不足提醒
平臺促銷活動及最新資訊
秒賽為開發者提供了詳細的API文檔和代碼示例,幫助開發者快速接入短信平臺
#include <stdio.h>
#include <curl/curl.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#define MAXPARAM 2048
CURL*curl;
CURLcoderes;
/**
* 本樣例依賴libcurl庫
* 下載地址 https://curl.haxx.se/download.html
*/
/* 短信內容 */
char
*msg =
"【秒賽科技】您的驗證碼是:1234"
;
/* 發送url 請咨詢客服 */
char
*url =
"http://139.196.108.241:8080/Api/HttpSendSMYzm.ashx"
;
void
send_data(
char
*url,
char
*data )
{
/* specify the url */
curl = curl_easy_init();
curl_easy_setopt( curl, CURLOPT_URL, url );
printf
(
"url:%s "
, url );
/* specify the POST data */
curl_easy_setopt( curl, CURLOPT_POSTFIELDS, data );
printf
(
"data:%s "
, data );
/* get response data */
CURLcode res = curl_easy_perform( curl );
printf
(
"%d "
, res );
/* printf(" "); */
}
/**
* 發送短信
*/
void
send_sms(
char
*url,
char
*account,
char
*pswd,
char
*mobile,
char
*msg )
{
charparams[MAXPARAM + 1];
char
*cp = params;
sprintf
( params,
"account=%s&pswd=%s&mobile=%s&msg=%s&needstatus=true"
, account, pswd, mobile, msg );
send_data( url, params );
}
int
main(
void
)
{
/* 賬號 */
char
*account =
"您的賬號"
;
/* 密碼 */
char
*pswd =
"您的密碼"
;
/* 修改為您要發送的手機號 */
char
*mobile =
"手機號"
;
/* 發送驗證碼短信 */
send_sms( url, account, pswd, mobile, msg );
return
(0);
}
認證、簽名模板審核結果通知
賬號短信余額不足提醒
平臺促銷活動及最新資訊