documentation
documentation copied to clipboard
C# Documentation is outdated
RestSharp is dead, should be using HttpClient instead.
Something like this:
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(string.Format("{0}:{1}", "api", MailGunApiKey))));
var content = new MultipartFormDataContent();
content.Add(new StringContent(from), "from");
content.Add(new StringContent(address), "to");
content.Add(new StringContent(subject), "subject");
content.Add(new StringContent(body), "text");
var result = await client.PostAsync("https://api.mailgun.net/v3/DOMAINGOESHERE/messages", content);