title: Simple upload gmail api Email
body: <p>Can someone teach me how to make a simple upload of file and send it in codeigniter using and Gmail api php thanks in advance so far i have this</p>
  
  <pre><code>    $user = 'me';
      $strRawMessage = "To: $sendTo \r\n";
  
      $strRawMessage .= "MIME-Version: 1.0\r\n";
      $strRawMessage .= "Content-Type: text/html; charset=utf-8\r\n";
      $strRawMessage .= 'Content-Transfer-Encoding: quoted-printable' . "\r\n\r\n";
      $strRawMessage .= " $message \r\n";
  
      $strRawMessage .= " Content-Type: image/jpeg\r\n";
      $strRawMessage .= "MIME-Version: 1.0\r\n";
      $strRawMessage .= 'Content-Transfer-Encoding: base64' . "\r\n\r\n";
      $strRawMessage .= "Content-Disposition: attachment; filename='test.jpg'\r\n";
  
      // The message needs to be encoded in Base64URL
  
      $mime = rtrim(strtr(base64_encode($strRawMessage), '+/', '-_'), '=');
      $msg = new Google_Service_Gmail_Message();
      $msg-&gt;setRaw($mime);
  
      // $service-&gt;users_messages-&gt;send("me", $msg);
  </code></pre>