title: sending email using cakephp via smtp
body: <p>i got a code working for sending basic email. but for smtp, i could not perfect this:</p>
  
  <pre><code>        function send(){
  
              $this-&gt;Email-&gt;smtpOptions = array(
                  'port'=&gt;'465', 
                  'timeout'=&gt;'30',
                  'host' =&gt; 'ssl://smtp.gmail.com',
                  'username'=&gt;'csorila@gmail.com',
                  'password'=&gt;'mypassword',
             );
  
          $this-&gt;Email-&gt;delivery='smtp';
  
              $this-&gt;Email-&gt;send = 'debug';
  
              $this-&gt;Email-&gt;to = 'csorila17@gmail.com'; 
          $this-&gt;Email-&gt;subject = 'hurrah'; 
  //        $this-&gt;Email-&gt;replyTo = 'noreply@example.com'; 
          $this-&gt;Email-&gt;from = 'Charmaine Khay Sorila&lt;noreply@example.com&gt;'; 
          //$this-&gt;Email-&gt;send('Here is the body of the email Chams Email Test');
          //Set the body of the mail as we send it. 
          //Note: the text can be an array, each element will appear as a 
          //seperate line in the message body. 
  
          if ( $this-&gt;Email-&gt;send() ) { 
              $this-&gt;Session-&gt;setFlash('Simple email sent'); 
          } else { 
              $this-&gt;Session-&gt;setFlash('Simple email not sent'); 
              $this-&gt;set('smtp_errors', $this-&gt;Email-&gt;smtpError);
          } 
          }
  
      }
  </code></pre>
  
  <p>i got this working without  $this->Email->delivery='smtp';, but when i added that line, no email can be sent at all  :(</p>