title: Cakephp email sent but not received
body: <p>I am running Cakephp 2.4.3 and am trying to send an email with CakeEmail.</p>
  
  <p>I have this code at the top of my UsersController:</p>
  
  <pre><code>App::uses('AppController','Controller','CakeEmail','Network/Email');
  </code></pre>
  
  <p>this function in the Controller:</p>
  
  <pre><code>function send_email(){
      try{
          $email = new CakeEmail('test');
          $email-&gt;from('sender@example.com');
          $email-&gt;to('me@gmail.com');
          $email-&gt;subject('Test');
          if($email-&gt;send('Test Message'))
              echo 'Success';
          else echo 'Failure without Exception';
      } catch (Exception $e){
          echo 'Failure with Exception';
      }
  }
  </code></pre>
  
  <p>and this in Config/email.php</p>
  
  <pre><code>public $test = array(
    'log' =&gt; true
  );
  </code></pre>
  
  <p>When I go to the url: mysite.com/users/send_email</p>
  
  <p>it says "Success" and the debug log says:</p>
  
  <pre><code>2014-05-30 22:49:43 Debug: 
  From: sender@example.com
  X-Mailer: CakePHP Email
  Date: Fri, 30 May 2014 22:49:43 +0000
  Message-ID: &lt;53890b07e3b44b2b88132a62ad2deb05@mysite.com&gt;
  MIME-Version: 1.0
  Content-Type: text/plain; charset=UTF-8
  Content-Transfer-Encoding: 8bit
  Test Message
  </code></pre>
  
  <p>but I never get an email coming into my Gmail account. I have checked my spam folder as well. What could be the issue and how else can I debug this?</p>
  
  <p>UPDATE:</p>
  
  <p>My cake app is being hosted on the web. I tried using a different email address at a different domain and changing the email code to this:</p>
  
  <pre><code>try{
      if(mail('xxx@iioengine.com','Test Subject','Test Message'))
          echo 'Success';
      else echo 'Failure without Exception';
  } catch (Exception $e){
      echo 'Failure with Exception';
  }
  </code></pre>
  
  <p>but the result did not change.</p>