title: How to send email through MailChimp 3.0 api?
body: <p>I'm trying to send email through mailchimp api version 3.0 in php, but i have no luck. This is my code:</p>
  
  <pre><code>$postString = '{
          "message": {
              "html": "this is the emails html content",
              "text": "this is the emails text content",
              "subject": "this is the subject",
              "from_email": "xxx@dyyy.sk",
              "from_name": "John",
              "to_email": "aaa.bbb@gmail.com",
              "to_name": "Anton",
              "track_opens": false,
              "track_clicks": false
          }}';
  
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $this-&gt;api_endpoint);
          curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 
          curl_setopt($ch, CURLOPT_USERPWD, 'drewm:'.$this-&gt;api_key);
          curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.api+json', 'Content-Type: application/vnd.api+json'));
          curl_setopt($ch, CURLOPT_USERAGENT, 'DrewM/MailChimp-API/3.0 (github.com/drewm/mailchimp-api)');
          curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
          curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this-&gt;verify_ssl);
          curl_setopt($ch, CURLOPT_POST, true);
          curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
          curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
  
          $result = curl_exec($ch);
  
          echo $result;
  </code></pre>
  
  <p>What am i doing wrong?</p>