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

问题描述 投票:2回答:1

我开发了一个聊天机器人,并将其部署在Skype上。我有一件新东西要添加到机器人中。

[如果用户要求在bot中使用办公室出租车,则bot必须接受用户输入(如目的地,emp-name等)并向特定的邮件ID(外观)发送电子邮件。

所以我的问题是:

  • 如何从Bot触发电子邮件?
botframework luis qnamaker
1个回答
0
投票

您可以使用SendGrid。这里有示例代码。

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

             mail.From = new MailAddress("[email protected]");
             mail.To.Add(useremail);
             mail.Subject = "";
             mail.Body ="";

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

             SmtpServer.Send(mail);

参考:How to make my bot send an e-mail to a given email address?

© www.soinside.com 2019 - 2024. All rights reserved.