问题描述
我正在使用Microsoft Bot Framework(.NET)构建一个机器人,我想要一个联系人"对话框,用户可以在其中编写主题,电子邮件的正文以及要将电子邮件发送到的用户.
I am building a bot using Microsoft Bot Framework (.NET) and I want a Contact dialog where the user writes the subject, the body of the email and the user he wants to send the email to.
例如,假设机器人用户在提问,如果机器人无法正确回答问题,我想抛出一个联系对话框,用户可以通过电子邮件与主管联系以询问他/她的问题.
For example, imagine the bot user is asking questions, if the bot can not propperly answer the question, I would like to throw a contact dialog where the user can contact the administration to ask his/her question via e-mail.
据我所知,我可以将电子邮件频道与Office 365电子邮件集成在一起,以便我的机器人可以应答电子邮件.但是,有没有办法发送电子邮件?我正在使用Direct Line API通道.
As far as I know, I can integrate the email channel with a Office 365 email so my bot can answer e-mails. But is there a way to send emails? I am using a Direct Line API channel.
谢谢你!
推荐答案
使用 SmptClient
或 SendGrid
发送电子邮件.StackOverflow上有许多示例,如下所示:通过发送电子邮件使用C#的SMTP
Use SmptClient
or SendGrid
to send your email for example. There are many samples on StackOverflow, like the following: Send e-mail via SMTP using C#
在这种情况下,使用 Email
频道不是一个好主意:它不会像您想要的那样管理流,并且是对该频道的滥用.电子邮件渠道是与其他渠道一样的渠道,必须用于对话,而不是出于特殊需要立即发送消息.
Using the Email
channel is not a good idea in this case: it will not manage the flow like you want, and is a misuse of the channel. Email channel is a channel like all the others, which must be used for a conversation, not to send a message at once for special needs.
这篇关于如何使我的机器人将电子邮件发送到给定的电子邮件地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!