2024-04-25 16:57:52 发布
网友
我已经在PostgreSQL和Python之间建立了关系。我提供了向使用Python的用户发送电子邮件的功能。我想向特定用户的手机发送消息。你知道吗
我分享了我的一部分代码:
Enter image description here
您可以使用Amazon SNS服务(简单通知服务)。它是一个REST服务,因此可以在任何语言中使用,包括Python。你知道吗
参见Using Amazon SNS for User Notifications with a Mobile Phone Number as a Subscriber (Send SMS)。你知道吗
Therearemanyresourcesaround。你知道吗
from smsapi import SmsApi username = "USERNAME" password = "PASSWORD" sms = SmsApi(username, password) total_points = sms.get_points()['points'] print("You have", total_points, "points left") cursor = conn.cursor() list_of_client_numbers = cursor.execute('''SELECT mobNumber FROM clientsTable''') for eachRecord in list_of_client_numbers: sms = sms.send_sms( recipient=eachRecord, sender_name="YOUR COMPANY NAME", message="MESSAGE", eco=False) conn.close() total_points = sms.get_points()['points'] print("You have", total_points, "points left")
您可以使用Amazon SNS服务(简单通知服务)。它是一个REST服务,因此可以在任何语言中使用,包括Python。你知道吗
参见Using Amazon SNS for User Notifications with a Mobile Phone Number as a Subscriber (Send SMS)。你知道吗
Therearemanyresourcesaround。你知道吗
代码
相关问题 更多 >
编程相关推荐