title: How to send email direct to gmail inbox not spam using codeigniter
body: <p>I want to send email using codeigniter to gmail inbox not span. i have written following code but email sent to spam not inbox.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;?php
  $this-&gt;load-&gt;library('email');
  
                          //SMTP &amp; mail configuration
                  $email = $this-&gt;input-&gt;post('email');
                          $config = array(
                              'protocol'  =&gt; 'tls',
                             // 'protocol'  =&gt; 'smtp',
                              'smtp_host' =&gt; 'ssl://smtp.googlemail.com',
                              'smtp_port' =&gt; 465,
                              'smtp_user' =&gt; 'mitesh.ebiztrait@gmail.com',
                              'smtp_pass' =&gt; '*****',
                              'mailtype'  =&gt; 'html',
                              'charset'   =&gt; 'utf-8',
                              'mailpath' =&gt; '/usr/sbin/sendmail',
                               'wordwrap' =&gt; TRUE,
                          );
                          $this-&gt;email-&gt;initialize($config);
                          $this-&gt;email-&gt;set_mailtype("html");
                          $this-&gt;email-&gt;set_newline("\r\n");
  
  
                          //Email content
                  $data = 'http://52.14.24.245/upload/images/purchasedticket/'.$qrcode_image;
  
                  $htmlContent .=  '&lt;!DOCTYPE html&gt;
                  &lt;html&gt;
                  &lt;head&gt;
                      &lt;meta charset="utf-8"&gt;
                      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
                      &lt;title&gt; &lt;/title&gt;
                      &lt;link rel="stylesheet" href=""&gt;
                  &lt;/head&gt;
                  &lt;body&gt; 
                      &lt;p&gt;Hi ,&lt;/p&gt;&lt;br&gt;
                      &lt;strong&gt;Payment for party ticket is successfull! &lt;/strong&gt;
  
                      &lt;p&gt;Following is the QR Code, kindly present this QR code while you attend the party. &lt;/p&gt;
                      &lt;br&gt;
                      URL : '.$data.'
                      &lt;br&gt;
                      &lt;img src="'.$data.'"  / &gt;&lt;br /&gt;
                      &lt;br&gt;
  
                      Thanksbr, &lt;br&gt;&lt;br&gt;
                      TheMove Team
                  &lt;/body&gt;
                  &lt;/html&gt;';
                          // $htmlContent = 'TheMove: party ticket purchase success!!';
                          // $htmlContent .= '&lt;p&gt;This email has sent via SMTP server from CodeIgniter application.&lt;/p&gt;';
  
                          $this-&gt;email-&gt;to($email);
                          $this-&gt;email-&gt;from('ashvin.ebiztrait@gmail.com','Party App');
                          $this-&gt;email-&gt;subject('TheMove: party ticket purchase success!!');
                          $this-&gt;email-&gt;message($htmlContent);
  
                          //Send email
                          $data = $this-&gt;email-&gt;send();   
  ?&gt;
  </code></pre>
  
  <p>How can i send email direct to gmail inbox not spam?</p>