Send Mail with Mailgun

Send Mail with Mailgun

I would like send mail with Mailgun. Anyone could help me?

I think to create a function that read from a record "To", "Subject", "Text".

Mailgun c# code is this, how can I translate it in Zoho Creator?
  1. public static RestResponse SendSimpleMessage() {
  2.     RestClient client = new RestClient();
  3.     client.BaseUrl = "https://api.mailgun.net/v3";
  4.     client.Authenticator =
  5.            new HttpBasicAuthenticator("api",
  6.                                       "key-bfac6e09124785239032fbae930fdd69c");
  7.     RestRequest request = new RestRequest();
  8.     request.AddParameter("domain",
  9.                         "sandboxf5eeef24d50c45edssf8fce7fb6304c4.mailgun.org", ParameterType.UrlSegment);
  10.     request.Resource = "{domain}/messages";
  11.     request.AddParameter("from", "Mailgun Sandbox <postmaster@sandboxf5eeef24d50c45edssf8fce7fb6304c4.mailgun.org>");
  12.     request.AddParameter("to", "Maurizio <maurizio.blg@cltn.it>");
  13.     request.AddParameter("subject", "Hello Maurizio");
  14.     request.AddParameter("text", "Congratulations Maurizio, you just sent an email with Mailgun!  You are truly awesome!  You can see a record of this email in your logs: https://mailgun.com/cp/log .  You can send up to 300 emails/day from this sandbox server.  Next, you should add your own domain so you can send 10,000 emails/month for free.");
  15.     request.Method = Method.POST;
  16.     return client.Execute(request);
  17. }
  18.