【问题标题】:Send multiple using Nexmo使用 Nexmo 发送多个
【发布时间】:2020-03-08 05:44:25
【问题描述】:

如何使用带有 python 的 nexmo 发送多个号码

import nexmo


client = nexmo.Client(key='exxxxx', secret='Qxxxxxx')
client.send_message({
    'from': 'Nexmo',
    'to': '639354758282',
    'text': 'Hello from Nexmo',
})

【问题讨论】:

  • 如果这些是您的真实凭据,您可能希望尽快停用它们。

标签: python vonage


【解决方案1】:

这个循环是否有助于为多个号码发送短信?或者,您正在寻找其他东西?

#!/usr/local/bin/python

import nexmo

client = nexmo.Client(key='*******', secret='*********')
phones = ['Number 1', 'Number 2', 'Number 2']

for phone in phones:
 msg = 'Hello ' + phone + ' from Nexmo'
 response = client.send_message({
    'from': 'Nexmo',
    'to': phone,
    'text': msg,
 })
 print(response)

【讨论】:

  • 我正在寻找如何发送多个号码
  • 请解释一下。您想向多个号码发送短信吗?如果是这样,我提供的上述脚本就可以了。只需将电话 Python 列表中的“数字 1”、“数字 2”和“数字 3”等替换为您要发送的数字即可。但是,如果您的要求有所不同,请详细说明。谢谢!
猜你喜欢
  • 2017-12-15
  • 1970-01-01
  • 1970-01-01
  • 2017-10-27
  • 2014-08-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多