title: Laravel - Call to undefined method Swift_SmtpTransport::newInstance()
body: <p>I'm using Swiftmailer to send email. I had installed 
  + "guzzlehttp/guzzle": "^6.3"
  + "swiftmailer/swiftmailer": "^6.0".</p>
  
  <p>I create controller and route for it. But it has issue "Call to undefined method Swift_SmtpTransport::newInstance()". Please check my code and guide me how to fix it? Thanks so much</p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Mail;
  use Swift_Mailer;
  use Swift_MailTransport;
  use Swift_Message;
  class EmailController extends Controller
  {
      public function sendEmail(){
          // Configuration
          $smtpAddress = 'smtp.zoho.com';
          $port = 465;
          $encryption = 'ssl';
          $yourEmail = 'ptc@gmail.com';
          $yourPassword = '********';
  
          // Prepare transport
          $transport = \Swift_SmtpTransport::newInstance($smtpAddress, $port, $encryption)
                  -&gt;setUsername($yourEmail)
                  -&gt;setPassword($yourPassword);
          $mailer = \Swift_Mailer::newInstance($transport);
  
          // Prepare content 
          $view = View::make('email_template', [
              'message' =&gt; '&lt;h1&gt;Hello World !&lt;/h1&gt;'
          ]);
  
          $html = $view-&gt;render();
  
          // Send email
          $message = \Swift_Message::newInstance('Test')
               -&gt;setFrom(['ptc@gmail.com' =&gt; 'Our Code World'])
               -&gt;setTo(["hik@gmail.com" =&gt; "mail@mail.com"])
               // If you want plain text instead, remove the second paramter of setBody
               -&gt;setBody($html, 'text/html');
  
          if($mailer-&gt;send($message)){
              echo "Check your inbox";
          }
  
          echo "Something went wrong :(";
      }
  }
  </code></pre>