title: How to send mail using cake php and where to start?
body: <p>I wanna try to send mail using cake php. I have no experience of sending mail. So, I don't know where to start. Is it need to make mail server? If need, how to make mail server and how to send mail? Please explain step by step. I really don't know where to start.</p>
  
  <p><strong>I'm using xampp and now I test my site at localhost.</strong></p>
  
  <p>I tested following link:</p>
  
  <p><a href="http://book.cakephp.org/view/1286/Sending-a-basic-message" rel="nofollow">http://book.cakephp.org/view/1286/Sending-a-basic-message</a></p>
  
  <p>but error occurred <strong>cannot be accessed directly.</strong></p>
  
  <p>and then I add code from the following link:</p>
  
  <p><a href="http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP" rel="nofollow">http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP</a></p>
  
  <p>So, my code is following:</p>
  
  <pre><code>    function _sendMail(){
      $this-&gt;Email-&gt;to = 'user@gmail.com';
      $this-&gt;Email-&gt;bcc = array('secret@example.coom');
      $this-&gt;Email-&gt;subject = 'Welcome to our really cool things';
      $this-&gt;Email-&gt;replyTo = 'support@example.com';
      $this-&gt;Email-&gt;from = 'Online Application &lt;app@example.coom&gt;';
      $this-&gt;Email-&gt;template = 'simple_message';
      $this-&gt;Email-&gt;sendAs = 'both';
  
      $this-&gt;Email-&gt;smtpOptions = array(
              'port' =&gt;'25',
          'timeout' =&gt; '30',
          'host' =&gt; 'ssl://smtp.gmail.com',
          'username' =&gt; 'my_mail@gmail.com',
          'password' =&gt;'aaa',
      );
      $this-&gt;Email-&gt;delivery = 'smtp';
      $this-&gt;Email-&gt;send();
     }
  </code></pre>
  
  <p>but error still occurred. But, I didn't make any mail server.Is that OK?</p>