简体   繁体   English

如何从微软机器人发送电子邮件?

[英]how to send an email from a microsoft bot?

I developed a chatbot and deployed it on skype.我开发了一个聊天机器人并将其部署在 Skype 上。 I have one new thing to be added to bot.我有一件新东西要添加到机器人中。

If a user requests for a office cab in bot then bot has to take user input(like destination, emp-name, etc) and send an email to a particular mail ID(outlook).如果用户在 bot 中请求办公室出租车,则 bot 必须接受用户输入(如目的地、emp-name 等)并向特定邮件 ID(outlook)发送电子邮件。

So my question is:所以我的问题是:

  • How to trigger an email from Bot?如何触发来自 Bot 的电子邮件?

You can use SendGrid.您可以使用 SendGrid。 Here with example code.这里有示例代码。

        System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
             SmtpClient SmtpServer = new SmtpClient("smtp.sendgrid.net");

             mail.From = new MailAddress("youremailaddress@gmail.com");
             mail.To.Add(useremail);
             mail.Subject = "";
             mail.Body ="";

             SmtpServer.Port = 587;
             SmtpServer.Credentials = new System.Net.NetworkCredential("apikey", "");
             SmtpServer.EnableSsl = true;

             SmtpServer.Send(mail);

References: How to make my bot send an e-mail to a given email address?参考资料: 如何让我的机器人向给定的电子邮件地址发送电子邮件?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Microsoft Graph 客户端作为其他用户从 Microsoft Teams Bot 发送电子邮件? - How to send email from Microsoft Teams Bot using Microsoft Graph Client as a different user? 自动 Email 发送 Microsoft Bot Framework Composer - Automatic Email Send in Microsoft Bot Framework Composer 从机器人发送上下文 - Microsoft 机器人框架 - Send context from bot - Microsoft bot framework 如何将表情符号从机器人发送给 Microsoft 团队中的用户 - How to send emojis from bot to user in Microsoft teams 如何将Microsoft Bot中的值发送到Javascript? - How do I send a value from a Microsoft Bot to Javascript? 如何从Microsoft Bot Framework发送SMS(使用Twilio通道)? - How to send SMS (using Twilio channel) from Microsoft Bot Framework? 在 Microsoft Bot Framework 中以电子邮件形式接收和发送附件 - Receive and Send Attachment as Email within Microsoft Bot Framework 从Postman发送消息给Microsoft Bot - Send message from Postman to Microsoft Bot 从Bot框架FormFlow发送电子邮件 - Send email from bot framework FormFlow 如何从机器人内部向 Microsoft 机器人发送消息,以便消息通过对话流并获得相应的响应? - How can I send a message to the Microsoft bot from within the bot so that the message will go through the dialog flow with corresponding response?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM