title: In Symfony 2 getting error like Fatal error: Class ...\Controller\Swift_SmtpTransport' not found?
body: <pre><code>I am  new to Symfony Swift mailer. I have tried the following code bellow to configure the username and password
  </code></pre>
  
  <p>But having problem loading such a  class like Swift_SmtpTransport.</p>
  
  <pre><code>   $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465)
                  -&gt;setUsername('xxxxxxxx@gmail.com')
                  -&gt;setPassword('yyyyyy');
  
      $mailer = Swift_Mailer::newInstance($transport);
  
      $message = Swift_Message::newInstance();
  
      $body="body-text";
      $subject="subject-text";
      $message-&gt;setSubject($subject)
          -&gt;setFrom('xxxxxxxxx@gmail.com')
          -&gt;setTo('zzzzzzzzz@gmail.com')
          -&gt;setContentType('text/html')
          -&gt;setBody($body);
      $result = $mailer-&gt;send($message);
      return $result;
  </code></pre>
  
  <p>Thanks in advance.</p>