#!/usr/local/bin/python #-*- coding:utf-8 -*- import httplib import urllib host = "sms.106jiekou.com" sms_send_uri = "/utf8/sms.aspx" #用戶名是登錄106jiekou.com賬號(hào)名 account = "用戶名" #接口密碼 password = "接口密碼" def send_sms(text, mobile): params = urllib.urlencode({'account': account, 'password' : password, 'content': text, 'mobile':mobile,'format':'json' }) headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"} conn = httplib.HTTPConnection(host, port=80, timeout=30) conn.request("POST", sms_send_uri, params, headers) response = conn.getresponse() response_str = response.read() conn.close() return response_str if __name__ == '__main__': mobile = "158xxxxxxxx" text = "您的訂單編碼:4557。如需幫助請(qǐng)聯(lián)系客服。" print(send_sms(text, mobile))
友情鏈接:106短信平臺(tái) | 發(fā)短信平臺(tái) | 短信接口平臺(tái) | 短信接口平臺(tái)哪個(gè)好 | 國(guó)際短信 | 短信通 | 短信接口應(yīng)用
關(guān)于我們 | 產(chǎn)品與服務(wù) | 解決方案 | 客戶案例 | 聯(lián)系我們 | 幫助指南 | 付款方式
Copyright © 2008-2018 短信通 . 速度網(wǎng)絡(luò)有限公司 短信接口應(yīng)用第一平臺(tái) All rights reserved. 浙ICP備10040624號(hào)-2