我是一名 Python 开发人员,但我现在正在从事的项目的情况迫使我在 Node.js 中找到解决方案
这是发送邮件的简单Python代码,但是,在nodejs中是否有像这样的谷歌应用程序引擎方式,而不使用像mailJet或sendGrid这样的中介服务?
def send(recipient, sender, subject, body):
isHTML=True
print("recep: "+recipient)
logging.debug(u'Sending mail {} to {}'.format(subject,
unicode(recipient)).encode(u'utf-8'))
message = mail.EmailMessage(
sender=sender,
subject=subject,
to=recipient
)
if isHTML:
message.html = body
else:
message.body = body
message.check_initialized()
message.send()
Run Code Online (Sandbox Code Playgroud)
感谢您的理解和帮助。
google-app-engine node.js google-api-nodejs-client google-cloud-platform
我正在使用Python 3.7和Flask 1.0.2
我将我的应用程序插入了mongoDB Atlas,在本地一切正常
客户端= pymongo.MongoClient(连接器)
连接器是Atlas给我的标准连接字符串
connector = "mongodb://xxx:<PASSWORD>@xxcluster-shard-00-00-y0phk.gcp.mongodb.net:27017,xxcluster-shard-00-01-y0phk.gcp.mongodb.net:27017,xxxcluster-shard-00-02-y0phk.gcp.mongodb.net:27017/test?ssl=true&replicaSet=xxxCluster-shard-0&authSource=admin&retryWrites=true"
Run Code Online (Sandbox Code Playgroud)
当我将应用程序部署到Google App Engine标准Python3运行时环境时,它不起作用。有人对这个问题有想法吗?
Appengine错误:
pymongo.errors.ServerSelectionTimeoutError:连接已关闭,连接已关闭,连接已关闭“