【Azure Logic App】在Azure Logic App中使用SMTP发送邮件示例

发布时间 2023-10-23 20:45:21作者: 路边两盏灯

问题描述

在Azure Logic App的官网介绍中,使用SMTP组件发送邮件非常简单(https://docs.azure.cn/zh-cn/connectors/connectors-create-api-smtp#connect-to-smtp)。

本文通过实际操作,配置SMTP,然后设置Email内容,最后触发Logic App并验证是否接受到邮件。

 

问题解答

第一步:准备SMTP信息

本文以outlook.com个人账号为例,通过链接 (获取Outlook的SMTP信息:https://outlook.live.com/owa/?auth=1&path=/options/popandimap

Outlook.com的SMTP信息为:

Server name: smtp.office365.com
Port: 587
Encryption method: STARTTLS

 

第二步:在Logic App 的SMTP 组件中配置SMTP 和邮件内容

选择SMTP --> Send Email (V3)

数据SMTP信息以及个人邮箱,密码

选择 To, Subject, Body,然后输入相应的模板内容

保存后,在Workflow的Overview页面中,获取触发Logic App的URL,发送POST请求验证。

 

完成示例如动图:

 

参考资料

从 Azure 逻辑应用连接到 SMTP 帐户 : https://docs.azure.cn/zh-cn/connectors/connectors-create-api-smtp#connect-to-smtp

smpt server ID and port # for live.com email account : https://answers.microsoft.com/en-us/outlook_com/forum/all/smpt-server-id-and-port-for-livecom-email-account/4d47d92b-494c-4f64-afd7-4c70f67e46d1

Setting up Outlook.com is simple as long as you know the POP3 and SMTP Settings. Listed below are the server settings that you are looking for:

  • IMAP server name imap-mail.outlook.com

  • IMAP port 993

  • IMAP encryption method TLS

  • POP server name pop-mail.outlook.com

  • POP port 995

  • POP encryption method TLS

  • SMTP server name smtp-mail.outlook.com

  • SMTP port 587

  • SMTP encryption method STARTTLS

 You can also see this information once you log in at https://outlook.live.com/owa/?auth=1&path=/options/popandimap

If you need clarifications, feel free to message us again.