使用阿里云消息服务mns发送短信

本文详细介绍了如何使用阿里云消息服务MNS来发送短信。从下载MNS工具开始,逐步讲解了解压、安装过程,最后通过具体示例展示发送短信的操作步骤。
摘要由CSDN通过智能技术生成

下载mns

wget http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32305/cn_zh/1490269182462/aliyun-mns-python-sdk-1.1.4.zip

解压

unzip aliyun-mns-python-sdk-1.1.4.zip

安装

cd mns_python_sdk
su - root
python setup.py install

运行

from mns.account import Account
from mns.topic import DirectSMSInfo, TopicMessage
from mns.mns_exception import MNSExceptionBase
'''
Step 1. 获取主题引用
'''
# 从https://account.console.aliyun.com/#/secure获取$YourAccountid
# 从https://ak-console.aliyun.com/#/accesskey获取$YourAccessId和$YourAccessKey
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值