【问题标题】:Send email from bot framework FormFlow从机器人框架 FormFlow 发送电子邮件
【发布时间】:2017-12-20 17:14:39
【问题描述】:

我有一个使用 FormFlow 创建的示例机器人:

public static IForm<SandwichOrder> BuildForm()
        {
            OnCompletionAsyncDelegate<SandwichOrder> processOrder = async (context, state) =>
            {
                await context.PostAsync("We are currently processing your sandwich. We will message you the status.");
            };

            return new FormBuilder<SandwichOrder>()
                        .Message("Welcome to the sandwich order bot!")
                        .Field(nameof(Sandwich))
                        .Field(nameof(Length))
                        .Field(nameof(Bread))
                        .Field(nameof(Cheese))
                        .AddRemainingFields()
                        .Message("Thanks for ordering a sandwich!")
                        .OnCompletion(processOrder)
                        .Build();
    }

表单完成后,控件位于:

OnCompletionAsyncDelegate<SandwichOrder> processOrder = async (context, state) =>
                {
                    await context.PostAsync("We are currently processing your sandwich. We will message you the status.");
                };

我想向自己发送一封包含所有表单字段的电子邮件。如何连接 SMTP 并编写电子邮件功能来发送包含所有选定选项和用户输入的电子邮件?

【问题讨论】:

    标签: botframework


    【解决方案1】:

    这个问题与Botframework无关,只是“如何从C#发送电子邮件”。

    您有多种选择,例如:

    • 使用 SendGrid
    • 使用SMTPClient(例如:Send e-mail via SMTP using C#
    • 如果您使用 Office 365 帐户(或在本地,但取决于配置等),则使用 Graph API
    • 使用 EWS(Exchange Web 服务)
    • 其他方式...

    您想在电子邮件中输入的字段包含在 state 变量中

    【讨论】:

      猜你喜欢
      • 2010-12-07
      • 1970-01-01
      • 2018-03-03
      • 1970-01-01
      • 2023-03-27
      • 2011-07-21
      • 1970-01-01
      • 1970-01-01
      • 2021-10-25
      相关资源
      最近更新 更多