我有一个使用FormFlow创建的示例bot:
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并编写电子邮件功能以发送包含用户所有选定选项和输入的电子邮件?
答案 0 :(得分:3)
此问题与Botframework
无关,只是“如何从C#发送电子邮件”。
您有几个选项,例如:
SMTPClient
(请点击此处查看:Send e-mail via SMTP using C#)您要在电子邮件中添加的字段包含在state
变量