4

I developed a chatbot and deployed it on 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).

So my question is:

  • How to trigger an email from Bot?
Wasif
  • 14,755
  • 3
  • 14
  • 34

2 Answers2

1

You can use 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?

Eng Soon Cheah
  • 257
  • 1
  • 10
  • 42
  • 1
    Just to add, SendGrid is a third party service but it does have a listing in the Azure Resource catalog. Start there and it should walk you through the rest. – billoverton Dec 16 '19 at 13:07
1

Try to use Email Skill from Bot Framework:

https://microsoft.github.io/botframework-solutions/skills/samples/email/

OlegL
  • 359
  • 4
  • 13