[英]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:所以我的问题是:
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?参考资料: 如何让我的机器人向给定的电子邮件地址发送电子邮件?
Try to use Email Skill from Bot Framework:尝试使用 Bot Framework 中的 Email Skill:
https://microsoft.github.io/botframework-solutions/skills/samples/email/ https://microsoft.github.io/botframework-solutions/skills/samples/email/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.