title: Send Email with SendGrid using Web Api php
body: <p>I am confused with here with $pass and $api_key 
  are they same, because at first $pass is assigned with password of the SendGrid's username but then api_key is assigned with $pass. 
  if they are same they where we would use that api_key that we generated on SendGrid?
  Please Help!!!</p>
  
  <pre><code>&lt;?php 
  $url = 'http://sendgrid.com/';
  $user = 'USERNAME';
  $pass = 'PASSWORD'; 
  
  $params = array(
      'api_user'  =&gt; $user,
      'api_key'   =&gt; $pass,
      'to'        =&gt; 'example3@sendgrid.com',
      'subject'   =&gt; 'testing from curl',
      'html'      =&gt; 'testing body',
      'text'      =&gt; 'testing body',
      'from'      =&gt; 'example@sendgrid.com',
    );
  
  
  $request =  $url.'api/mail.send.json';
  
  // Generate curl request
  $session = curl_init($request);
  // Tell curl to use HTTP POST
  curl_setopt ($session, CURLOPT_POST, true);
  // Tell curl that this is the body of the POST
  curl_setopt ($session, CURLOPT_POSTFIELDS, $params);
  // Tell curl not to return headers, but do return the response
  curl_setopt($session, CURLOPT_HEADER, false);
  curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
  
  // obtain response
  $response = curl_exec($session);
  curl_close($session);
  
  // print everything out
  print_r($response);
  
  ?&gt;
  </code></pre>