Email API Integration Guide with C#

Minimum code that you need to integrate Mailazy with your .Net application


You need to complete these given prerequisites, you can skip the step if you have already completed.

  1. Sign up for a Mailazy account.
  2. Complete Domain Authentication.
  3. Generate the Mailazy Access Key

Integrate Mailazy with C#

Start Sending mail using the code provided below:

var client = new RestClient("");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("X-Api-Key", "<API KEY>");
request.AddHeader("X-Api-Secret", "<API SECRET>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{" +
      "\"to\": [\"[email protected]\"]," +
      "\"from\": \"Sender <[email protected]>\"," +
      "\"subject\": \"<Subject>\"," +
      "\"content\": [{\"type\": \"text/plain\",\"value\": \"<Content>\"}]" +
    "}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);