title: Swiftmailer - Uncaught Error: Call to undefined method Swift_SmtpTransport::newInstance()
body: <p>I'm trying to send email using the <code>Swiftmailer</code>.</p>
  
  <p>I'm getting an Uncaught Error: </p>
  
  <blockquote>
    <p>Call to undefined method Swift_SmtpTransport::newInstance().</p>
  </blockquote>
  
  <p>Here is the code:</p>
  
  <pre><code>require_once 'swift/lib/swift_required.php';
  
  $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
        -&gt;setUsername ('email@gmail.com')
        -&gt;setPassword ('password');
  
  $mailer = Swift_Mailer::newInstance($transport);
  
  $message = Swift_Message::newInstance('Weekly Hours')
         -&gt;setFrom (array('email@gmail.com' =&gt; 'My Name'))
         -&gt;setTo (array('email@hotmail.com' =&gt; 'Recipient'))
         -&gt;setSubject ('Weekly Hours')
         -&gt;setBody ('Test Message', 'text/html');
  
  $result = $mailer-&gt;send($message);
  </code></pre>
  
  <p>Based on the above code, what would be causing that mistake?  </p>