我正在尝试创建一个简单的hello world逻辑应用程序,通过电子邮件发送给自己。
我添加了SMTP连接器,并为Google填写了以下属性:
服务器:smtp.google.com
港口:465(587也尝试失败)
UserAccount:xtenxxx@gmail.com
密码:xpassxx
SSL:True
然后创建API后,我使用了:
收件人:xtenxxx@gmail.com
主题:测试
身体:测试
我手动运行它并收到此错误:
{“code”:“BadRequest”,“message”:“Http请求失败:已达到超时。”}
我可以毫无问题地使用Twitter和Dropbox等其他连接器。所以我假设它必须是我投入的API参数。
任何指导都将不胜感激。感谢
编辑添加CodeView:
{
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2014-12-01-preview/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"/subscriptions/49c83dfe-f987-4e2e-8b23-c6ceb2c4855e/resourceGroups/Default-Web-EastUS/providers/Microsoft.AppService/apiApps/SMTPConnector/token": {
"type": "String",
"defaultValue": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtc25hbWUiOiJFTUEuUmVzb3VyY2VQcm92aWRlciIsImZ1bGxyb3ciOiJhbGwiLCJkYmciOiJEZWZhdWx0LVdlYi1FYXN0VVM0OWM4M2RmZWY5ODc0ZTJlOGIyM2M2Y2ViMmM0ODU1ZSw1MzE3ODQxNDIiLCJ2ZXIiOiIzIiwidWlkIjoic2lkOjE0MzUwNzU5MjE3MzMiLCJpc3MiOiJ1cm46bWljcm9zb2Z0OndpbmRvd3MtYXp1cmU6enVtbyIsImF1ZCI6InVybjptaWNyb3NvZnQ6d2luZG93cy1henVyZTp6dW1vIiwibmJmIjoxNDM1MDc1OTIyfQ.VK1gtDPgaxaaEhp_9AZYtVR2BD8gLrDaKKcYyFpg_lk",
"metadata": {
"token": {
"name": "/subscriptions/49c83dfe-f987-4e2e-8b23-c6ceb2c4855e/resourcegroups/default-web-eastus/providers/Microsoft.AppService/apiapps/smtpconnector/token"
}
}
},
"/subscriptions/49c83dfe-f987-4e2e-8b23-c6ceb2c4855e/resourcegroups/default-web-eastus/providers/Microsoft.AppService/apiapps/twitterconnector/token": {
"defaultValue": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtc25hbWUiOiJFTUEuUmVzb3VyY2VQcm92aWRlciIsImZ1bGxyb3ciOiJhbGwiLCJkYmciOiJEZWZhdWx0LVdlYi1FYXN0VVM0OWM4M2RmZWY5ODc0ZTJlOGIyM2M2Y2ViMmM0ODU1ZSw1MzE3ODQxNDIiLCJ2ZXIiOiIzIiwidWlkIjoic2lkOjE0MzUwNzYxMDIwMTQiLCJpc3MiOiJ1cm46bWljcm9zb2Z0OndpbmRvd3MtYXp1cmU6enVtbyIsImF1ZCI6InVybjptaWNyb3NvZnQ6d2luZG93cy1henVyZTp6dW1vIiwibmJmIjoxNDM1MDc2MTAzfQ.GSyp45LKqNsN_vi1FQlYBj8h_yAybXQsX8WKSXTcvNc",
"type": "String",
"metadata": {
"token": {
"name": "/subscriptions/49c83dfe-f987-4e2e-8b23-c6ceb2c4855e/resourcegroups/default-web-eastus/providers/Microsoft.AppService/apiapps/twitterconnector/token"
}
}
}
},
"triggers": {
"recurrence": {
"type": "Recurrence",
"recurrence": {
"frequency": "Hour",
"interval": 1
}
}
},
"actions": {
"smtpconnector": {
"type": "ApiApp",
"inputs": {
"apiVersion": "2015-01-14",
"host": {
"id": "/subscriptions/49c83dfe-f987-4e2e-8b23-c6ceb2c4855e/resourcegroups/default-web-eastus/providers/Microsoft.AppService/apiapps/smtpconnector",
"gateway": "https://default-web-eastus49c83dfef9874e2e8b23c6ceb2c4855e.azurewebsites.net"
},
"operation": "SendEmail",
"parameters": {
"emailDetails": {
"To": "ctenden@gmail.com",
"Subject": "Test",
"Body": "Test"
}
},
"authentication": {
"type": "Raw",
"scheme": "Zumo",
"parameter": "@parameters('/subscriptions/49c83dfe-f987-4e2e-8b23-c6ceb2c4855e/resourcegroups/default-web-eastus/providers/Microsoft.AppService/apiapps/smtpconnector/token')"
}
},
"conditions": []
}
},
"outputs": {}
}
答案 0 :(得分:0)
当我使用端口587而不是465时,这适用于使用逻辑应用程序的gmail.com。