[英]How to send email from Microsoft Teams Bot using Microsoft Graph Client as a different user?
[英]how to send an email from a microsoft bot?
我开发了一个聊天机器人并将其部署在 Skype 上。 我有一件新东西要添加到机器人中。
如果用户在 bot 中请求办公室出租车,则 bot 必须接受用户输入(如目的地、emp-name 等)并向特定邮件 ID(outlook)发送电子邮件。
所以我的问题是:
您可以使用 SendGrid。 这里有示例代码。
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);
尝试使用 Bot Framework 中的 Email Skill:
https://microsoft.github.io/botframework-solutions/skills/samples/email/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.