title: Send mail in Zend Framework showing an exception
body: <p>I am trying to send an email in zend framework on localhost. </p>
  
  <p>Following is my code : </p>
  
  <pre><code>$mail = new Zend_Mail('utf-8');
          $mail-&gt;addTo($email);
          $mail-&gt;setSubject('Welcome');
          $mail-&gt;setFrom('test@user.com', 'test@user.com');
          $mail-&gt;setBodyText($bodyText);
          $sent = true;
  
          // Send the email
          try {
              $mail-&gt;send();
          } catch (Exception $e) {
              echo "&lt;pre&gt;";
              print_r($e);
              exit;
              $sent = false;
          }
          return $sent;
  </code></pre>
  
  <p>But its showing the following exception : </p>
  
  <blockquote>
    <p>[message:protected] => Unable to send mail. mail() [function.mail]:
    Failed to connect to mailserver at "localhost" port 25, verify your
    "SMTP" and "smtp_port" setting in php.ini or use ini_set()</p>
  </blockquote>
  
  <p>Following is my setting in php.ini</p>
  
  <pre><code>[mail function]
  ; For Win32 only.
  ; http://php.net/smtp
  SMTP = localhost
  ; http://php.net/smtp-port
  smtp_port = 25
  
  
  ; For Win32 only.
  ; http://php.net/sendmail-from
  sendmail_from = test@user.com
  </code></pre>
  
  <p>I am using PHP Version 5.3.9, Wampserver 2.2.</p>
  
  <p>How to resolve this error?</p>