title: Swiftmailer Caught exception: Expected response code 250 but got code "", with message ""
body: <p>I'm having trouble in symfony 1.4 swiftmailer .
  When I try to use sendmail function() 
  I got error code :</p>
  
  <pre><code>Caught exception: Expected response code 250 but got code "", with message ""
  </code></pre>
  
  <p>And symfony doesn't send messages.</p>
  
  <p>Below is my function sendmail</p>
  
  <pre><code>static function sendmail($mail, $textmessage, $subject) {
      try {
          $message = Swift_Message::newInstance()
                  -&gt;setFrom(sfConfig::get('app_mail_address_from'))
                  -&gt;setTo($mail)
                  -&gt;setSubject($subject)
                  -&gt;setBody($textmessage)
                  -&gt;setContentType("text/html");
        //  sfContext::getInstance()-&gt;getMailer()-&gt;send($message);
        sfContext::getInstance()-&gt;getMailer()-&gt;send($message);
      //   mail("mymailcom", "A subject", "A message", "FROM: noreply@mail.com");
  
      } catch (Exception $e) {
          echo 'Caught exception: ', $e-&gt;getMessage(), "\n";
      }
  
  
  }
  </code></pre>
  
  <p>What I tried to do:</p>
  
  <ol>
  <li><p>I tried to test mail() function. It works good.</p></li>
  <li><p>I tried to change smtp settings to gmail account - not working</p></li>
  </ol>
  
  <p>My Server is: CentOs6 on godaddy.co.uk server</p>
  
  <p>Can somebody please help me with this error ? </p>