title: How to add content to newsletter in Mailjet API v3 using ASP .NET MVC 5
body: <p>I am able to send empty newsletters. But I dont know how to add content to them. Example given by the Mailjet (<a href="http://dev.mailjet.com/guides/newsletter-guide/" rel="nofollow">http://dev.mailjet.com/guides/newsletter-guide/</a>) does not help much. I get 500 Internal Server Error most of the time.</p>
  
  <p>Calling method:</p>
  
  <pre><code>NewsLetterHtmlAdd newsLetterAdd = new NewsLetterHtmlAdd
          {
              ID = idNewsletter,
              Data = string.Format("&lt;!DOCTYPE html" +
                                   "&lt;html&gt;" +
                                   "&lt;head&gt;" +
                                   "&lt;meta content='text/html; charset=utf-8' http-equiv='Content-Type' /&gt;" +
                                   "&lt;title&gt;Subject&lt;/title&gt;" +
                                   "&lt;/head&gt;" +
                                   "&lt;body&gt;" +
                                   "&lt;p style='text-align: center'&gt;Sender &lt;a href='mailto:[[EMAIL_TO]]'&gt;[[EMAIL_TO]]&lt;/a&gt;, " + "&lt;a href='[[UNSUB_LINK_EN]]'&gt;Unsubscribe here&lt;/a&gt;.&lt;/p&gt;"
                                   +
                                   "&lt;/body&gt;" +
                                   "&lt;/html&gt;")
          };
  client.NewsLetterHtmlAdd(newsLetterAdd);
  </code></pre>
  
  <p>Method:</p>
  
  <pre><code>    public void NewsLetterHtmlAdd(NewsLetterHtmlAdd newsLetterHtmlAdd)
      {
  string url = "https://api.mailjet.com/v3/DATA/NewsLetter/"
                       + newsLetterHtmlAdd.ID + "/HTML/text/html/";
  
  
  
          byte[] byteArray = new byte[newsLetterHtmlAdd.Data.Length*sizeof (char)];
          Buffer.BlockCopy(newsLetterHtmlAdd.Data.ToCharArray(), 0, byteArray, 0, byteArray.Length);
          WebRequest request = WebRequest.Create(url);
          request.Credentials = new NetworkCredential(_apiKey, _secretKey);
          request.Method = "POST";
          request.ContentLength = byteArray.Length;
          request.ContentType = "text/html";
          Stream dataStream = request.GetRequestStream();
          dataStream.Write(byteArray, 0, byteArray.Length);
          dataStream.Close();
          WebResponse response = request.GetResponse();
      }
  </code></pre>
  
  <p>ViewModel:</p>
  
  <pre><code>using System.Runtime.Serialization;
  
  namespace MailJet.Newsletter
  {  [DataContract] 
  public class NewsLetterHtmlAdd
  {
  
  [DataMember(Name = "id")]
  public long ID { get; set; }
  
  
  [DataMember(Name = "data")]
  public string Data { get; set; }
  }
  }
  </code></pre>