[英]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.